Translating

This guide is about translating WackoWiki to another language.


WackoWiki‘s userinterface can be configured to use any language by setting the appropriate option. Have a look in the lang directory to see which languages are available. To translate WackoWiki to your own language, copy the lang/en directory to a new one named after your ISO language code.


1. Supported Languages


# User Documentation Localization Repository Charset Abbr. Maintainer
1 Deutsch Deutsch iso-8859-1 de WikiAdmin
2 English English? iso-8859-1 en
3 Spanish ((!/es )) iso-8859-1 es KlePy
4 French Français iso-8859-1 fr Didier Spaier
5 Polski Polski? iso-8859-2 pl
6 Portugues ((!/pt )) iso-8859-1 pt
7 Russain ((!/ru )) windows-1251 ru DrFreeman, Elar9000
8Bulgarian Bulgarian? windows-1251 bg
9 Italian ((!/it )) iso-8859-1 it
10 Danish Danish iso-8859-1 da
11 Estonian((!/et )) windows-1257 et
12 Hungarian Hungarian((!/hu )) iso-8859-2 hu
13 Dutch ((!/nl )) iso-8859-1 nl
14 Greek Ελληνικά iso-8859-7 el EvaggelosBalaskas

Important: Please note that we have not verified those translations. If you believe that a translation is false or misleading, please contact us.

2. Message sets

2.1. Locations

Message sets can be found under the following locations:


Repo: https://bitbucket.org/wackowiki/wackowiki-dev/src/tip/


wacko/

  1. admin/lang/
  2. js/lang/
  3. lang/
  4. setup/lang/
  5. theme/yourtheme/lang/

2.2. To Localize

Please check your language files whether the following message sets have yet to be translated into your language or whether the wording can be improved.

2.2.1. Main


lang/

  1. lang/wacko.en.php – default language file

2.2.2. Installer


setup/lang/

  1. setup/lang/installer.en.php – default language file
  2. setup/lang/inserts.en.php

2.2.3. Admin panel


admin/lang/

  1. admin/lang/ap.en.php – default language file

2.2.4. JavaScript


js/lang/

  1. js/lang/wikiedit.en.js – default language file

2.2.5. Theme


theme/

  1. theme/yourtheme/lang/ – default language file

3. Documentation


Core pages to translate


# Page Languages Notes
1 Features de
2 Requirements de
3 Installation de, ru
4 Upgrade de, ru
5 Configuration de, ru
6 Content-Security-Policy?
7 Formatting de, ru
8 Actions de, ru
9 Access Control Lists de, ru
10 Admin Panel de, ru
11 WikiConcept de, ru
12 Markup de, ru
13 Wabi-sabi de, ru
14
15

It is desirable to have all essential pages available at least in German, English, French and Spanish.

4. Help to improve translation

Don't see your native language here? Is a translation incomplete or improper?


If your ability in English is sufficient to produce high-quality translations of English texts in a formal style, you can volunteer to translate WackoWiki.


Forum: Translation

  1. you want to start a new translation or continue an existing one and you want to avoid duplicating your work with someone else
  2. you're looking for other people who want to work with you on translating
  3. you're having technical questions about tools, the source tree, the meaning of terms, etc.

5. Localize your action or module

lang/wacko.en.php

'UserName'	=> 'User name',

usage
$this->_t('UserName')


admin/lang/ap.en.php

'BackupCompleted'	=> 'Backing up and archiving completed.<br>' .
	'The Backup package files were stored in the sub-directory %1.<br>' .
	'To download it use FTP (maintain the directory structure and file names when copying).<br>' .
	'To restore a backup copy or remove a package, go to <a href="%2">Restore database</a>.',

usage
Ut::perc_replace(
	$engine->_t('BackupCompleted'), 
	'<code>' . $pack . '</code>', 
	$engine->href('', '', ['mode' => 'db_restore']))

6. Tools

6.1. relang.php

  • sync message sets in all language files based on default file (en)
    1. source:community/devel/relang.php
    • add/delete to english, run # relang wacko.en.php wacko.??.php and all set & done
    • /*
       * ./relang.php wacko.en.php wacko.bg.php wacko.da.php wacko.de.php wacko.el.php wacko.es.php wacko.et.php wacko.fr.php wacko.hu.php \
       * 			wacko.it.php wacko.nl.php wacko.pl.php wacko.pt.php wacko.ru.php
       *
       * all changes in en.php (first file) will be moved to other files.
       * all deletions will be made.
       * all additions will be made.
       * all reordering will be made (but values remain localized if already was)
       * incl. comments! :)
       *
       * no need to sync ALL languages manually - just edit english and push changes to other langs
       * (new messages will be english, though, and if translation is available but you change %1 or other
       * formatting - be aware: it is better to remove it, resync to other langs, than add new, resync again.
       * translation would be lost, though)
       *
       * you can massively rename resource names, without losing available localizations:
       * use meta-comment in parent (first in cmd line) file:
      	// RENAME OldTag NewTag
      	'NewTag' => ...
       * e.g. resource himself must be manually renamed in parent
       * after running 'relang wacko.en.php wacko.??.php' then - RENAME comment will be stripped from .en. too
       *
       * enjoy! /sts
       *
       *//// NB /*...*/ comments in language files not supported!

In *nix systems, use the WHICH command to show the location of the php binary executable. This is the path to use as the first line in your php shell script file.


 # which php
/usr/local/bin/php


 cd /yourpathto/repo/community/devel


 php ./relang.php /yourpathto/repo/wacko.en.php wacko.bg.php wacko.da.php wacko.de.php wacko.el.php wacko.es.php wacko.et.php wacko.fr.php wacko.hu.php wacko.it.php wacko.nl.php wacko.pl.php wacko.pt.php wacko.ru.php

6.1.1. Issues

6.1.1.1. no var

 no var in /home/user/workspace/dev/wacko/lang/wacko.en.php

FIXED diff --git a/community/devel/relang.php b/community/devel/relang.php
 --- a/community/devel/relang.php
+++ b/community/devel/relang.php
@@ -57,7 +57,7 @@
 	$contents = trim($contents);
 
 	$parent = 0;
-	if (!preg_match('/\$([\w_]+)\s*=\s*array\s*\(/', $contents, $match))
+	if (!preg_match('/\$([\w_]+)\s*=\s*\[/', $contents, $match))
 	{
 		if (!$defvar) die("no var in $fname\n");
 		$var = $defvar;

6.1.1.2. dupe messages

 php ./relang.php /home/user/workspace/dev/wacko/admin/lang/ap.en.php /home/user/workspace/dev/wacko/admin/lang/ap.bg.php

 dupe messages in /home/user/workspace/dev/wacko/admin/lang/ap.en.php

Complains about a dupe set but in another sub array

6.2. Machine translation


  1. https://translate.google.com/
  2. https://translate.yandex.ru/
  3. https://www.bing.com/translator/
  4. https://www.deepl.com/translator
  5. http://mymemory.translated.net/
  6. http://www.apertium.org/
  7. Firefox Addon

7. Suggestions

  1. Proposed Specifications For Languages Holding