Download
You can download the testing package with gettext support, some directories have been removed in order to reduce the file size.It should be installed like the normal Wikka, the only additional option in the setup process is the language selection. There are 2 languages available right now: Catalan and English. You can try to install it in catalan to see that the final result is a Wikka site, but in catalan (there are some missing strings).
wikka-1.1.5.3-gettext.tar.gz (140k) Updated on October 6, 2004
Tasks
- gettext support -- done
- different domains (wikka and wikka-setup) -- done
- locale selection from the installer -- done
- script to update po files -- done
- make strings translatable -- 142 strings so far
- wikka.pot: 101 strings
- wikka-setup.pot: 41 strings
Known problems
Hardcoded WikiPagesactions/textsearch.php:22 TextSearchExpand actions/footer.php:3 TextSearch actions/usersettings.php:118 MyPages actions/usersettings.php:119 MyChanges actions/category.php:8 Category Category
If we want to let users choose their preferred language from usersettings, we can't translate hardcoded WikiPages. These are always the same, since they are on the database and were translated in the setup process. Possible solutions:
- Do not translate page tags.
- Add these hardcoded pages to the config file with their respective name, so that we can use $config["MyPages"] instead of MyPages.
Php Gettext, a class that can read directly mo files
At http://savannah.nongnu.org/projects/php-gettext/ , you can find a class consisting of 2 files that can read mo files even if you don't have gettext support installed. It doesn't require anything other than PHP, and its size is absolutely small. I (-- DotMG --) was not a fan of Gettext until I found this class. It is GPL-licensed.FAQ
How to make strings translatable with gettext?It is simple, just use the _() or gettext() function.
Example (simple):
<?php
print(_("Hello Wikka!"));
?>
print(_("Hello Wikka!"));
?>
Example (formatted):
<?php
$here = $this->Format('[[PasswordForgotten | '._("here").']]');
printf(_("If you need a temporary password, click %s."), $here);
?>
$here = $this->Format('[[PasswordForgotten | '._("here").']]');
printf(_("If you need a temporary password, click %s."), $here);
?>
What do we gain with gettext?
- automatic detection of outdated translation strings
- standard framework so that existing translation teams can work on wikka at no cost