Let me try to get the most important theme across to you about the LanguageHandler
class.
The LanguageHandler
class is:
- dumb, ie, it has no “smarts” nor “intelligence”
- it is a simple “lookup” function
- it look’s up a key being an English string in a Ruby
Hash
, and returns the string value for that key. - the string value is the local language that YOU manually translated when you created all the various
.strings
files for your extension.
- it look’s up a key being an English string in a Ruby
- the
LanguageHandler
class does NOT translate English “on-the-fly” (because most translation engines on the web, forbid their use this way.) - the
LanguageHandler
class uses twice the amount of memory just loading your translated strings into a Ruby hash does.
For these reasons, I do not use the LanguageHandler
class at all. I just write Ruby files (that are part of the extension’s files,) that define a language hash (within my extension module) that uses short symbol keys.