Revision [2175]

This is an old revision of WikkaGettext made by JordaPolo on 2004-11-12 19:52:40.

 

In order to improve the I18N of Wikka, it could be a good idea to add support for different interface translations. The best way to handle this kind of translations is using gettext which is a mature, widely used (wordpress, phpwiki) localization framework. It is pretty much the defacto standard in the open source/free software realm.

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
  1. gettext support -- done
  1. different domains (wikka and wikka-setup) -- done
  1. locale selection from the installer -- done
  1. script to update po files -- done
  1. make strings translatable -- 142 strings so far

Known problems
Hardcoded WikiPages
actions/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:

FAQ
How to make strings translatable with gettext?
It is simple, just use the _() or gettext() function.

Example (simple):
<?php
    print(_("Hello Wikka!"));
?>

Example (formatted):
<?php
    $here = $this->Format('[[PasswordForgotten '._("here").']]');
    printf(_("If you need a temporary password, click %s."), $here);
?>


What do we gain with gettext?

Categories
CategoryDevelopment
There are 30 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki