Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
GNU gettext : Much Better method for localization
I don't know if this is possible or not .. I haven't seen any discussions about this here ...
If Mark could change the way Vanilla uses language files and start using GNU gettext it would be very very easy to localize Vanilla , no matter how the versions changes ... also it will be easier for anyone translating to catch typos and mark un-decided translations as Fuzzy .. so that other translators be able to fix it ... as you may have noticed translation of PO files is very easy using either poEdit for windows http://www.poedit.org/ or Kbabel for linux http://kbabel.kde.org/ ... or if you prefer ... you can use any Unicode capable text editor ... see the popular Filezilla page as an example for the greatness of gettext http://filezilla-project.org/translations.php
0
This discussion has been closed.
Comments
I don't think Mark is willing to switch.
I did, as a test, a simple gettext switch, converting languages definitions to gettext format and hacking the GetDefinition method to a gettext() wrapper.
Anyway, I'm still unsure if I'll use it or stay standard. Using it offer a better integration with other site code, but require maintenance.
?
I uploaded the .mo an .po file for English and French, in this zip file.
I converted it with a few find/replace pattern or sed command, don't remenber, but it's easy.
To use it you should modify the file library/Framework/Framework.Class.Context.php as follow:
function GetDefinition($Code) { //test Max_B return gettext($Code); /* if (array_key_exists($Code, $this->Dictionary)) { return $this->Dictionary[$Code]; } else { return $Code; } */ }
I'd be more efficient to replace all occurences or GetDefinition() with gettext() but then you are REALLY out of sync at next upgrade!
…but from your last comment I'm not sure if you should go this way:
- text you see on screen just mean there is NO dictionary available…
- Modifying the GetDefinition() code is not the only step to activate gettext. Besid having the right translation file in the right place you'd also add a few lines of code somewhere, say in conf/language.php or in a custom extension or whatever.
Here are the minimum requested lines:
//init gettext putenv("LANG=$lang"); setlocale(LC_MESSAGES, $lang); bindtextdomain('messages', 'i18n'); textdomain('messages');
Where $lang contain the language code you want and "i18n" is the directory where you put the translation files.
This is NOT a ready made exension, this is a little help to find your way, but then you are on your own.