[geeklog-devel] IMPORTANT: More language talk

Tony Bibbs tony at tonybibbs.com
Fri Jan 24 12:01:21 EST 2003


After some critial thinking I don't think we can do both gettext AND our 
current array-based method of doing translations.  Why?

Well here is the gettext() process in a nutshell.  Let's say you have a 
bunch of .php pages in some directory.  To get a translated string you:
1) get user's locale
2) set locale
3) where you need a translating string put gettext('some english text');

Then when you are done with development you do something like:

1) run a commandline gettext function on all PHP pages.  This creates a 
.po file.  IN this file you will have entries like:
msgid 'some english text'
msgstr ''

msgid 'some other text'
msgstr ''

etc

2) distribute .po file to all translators
3) receive translated .po files back 
4) convert .po file to .mo file.  .mo is teh file that gettext actually 
used.

Now bare with me.  Originally I thought I could support both gettext *and* 
our current method by simply creating a translator class.  Use would have 
been similar to this:

$translator = &translationFactory::getTranslatorClass($method);
$translator->getText('some english text');

NOTE: the translationFactory takes a method (gettext or array) and returns 
the appropriate translator.  Then the method calls are the same for both.

Will if you are following this, the problem is when you run the xgettext 
(the command that takes PHP files and makes the .mo file) it won't 
generate anything...at least I don't think so...because it will be 
specifically looking for the gettext() function call.

So, in my opinion we need to really decide on a method and stick with it.  
I haven't heard any screaming or kicking about ISP's inability to handle 
this so should we go with it or just stick with what we got? 

For me it's a tough decision,  gettext is much more elegant and is 
probably faster and easier on system resources than loading complete 
language arrays into memory.  However, we do run the risk of alienating 
the few who's ISP don't support gettext().  

Honestly, I think I'm OK with using gettext().  That's just point of view 
now.  What are your thoughts?

-- 
------------------------------------------------------------------------|
Tony Bibbs         | "I guess you have to remember that those who don't |   
tony at tonybibbs.com | hunt or fish often see those of us who do as       |
                   | harmlessly strange and sort of amusing. When you   | 
                   | think about it, that might be a fair assessment."  | 
                   | --Unknown                                          |
------------------------------------------------------------------------|





More information about the geeklog-devel mailing list