[geeklog-devel] Translation possibility
Tony Bibbs
tony at tonybibbs.com
Wed Jan 29 15:46:36 EST 2003
Actually, that is the point of the XML file. We could automate the
creation of the XML file by running a script against all the PHP code.
Then you just point the developers in one place. Thus, in your code you
have stuff like:
$trans->getText('some english phrase');
$trans->getText('some other phrase');
etc.
Then,
#>glgettext.sh > translation.xml
Then give the XML file to all the translators. When you get it back you
can leave it in the XML *or*:
#>glmakepo.sh translatedfile.xml > somegettext.po
Then you run some gettext function against to .po to get the binary .mo
file so gettext can use it.
Did this make any sense? Beauty is, you don't need an english translation
file at all which saves you time while your coding from having to go to
english.php to add some text everytime you need to print something.
--Tony
On Wed, 29 Jan 2003, Tom Willett wrote:
> I would stick with 2b -- simplest is best as far as I am concerned. Running
> two parallel systems and trying to keep them in sync is asking for trouble.
>
> TomW
> On Wed, 29 Jan 2003 09:04:14 -0600 (CST), Tony Bibbs wrote
> > Ok, it seems there could be issues with gettext not working on macosx. I
> > will probably stick wtih the concept below. Please give me some sort of
> > head nod if you think the approach below makes sense.
> >
> > --Tony
> >
> > On Fri, 24 Jan 2003,
> > Tony Bibbs wrote:
> >
> > > Ok, bare with me but I think I have a potential way of handling this
> > > translation issue.
> > >
> > > 1) We create an xml file for all languages other than english that looks
> > > like this:
> > > <GL2_Translation>
> > > <language>de</language>
> > > <GL_version></GL_version>
> > > <translations>
> > > <entry msgid="some english text">translated text</entry>
> > > <entry msgid="some other text">other translated text</entry>
> > > .
> > > .
> > > .
> > > </translations>
> > > </GL2_Translation>
> > > 2) During automated install, the translation type is queried from the
> > > user.
> > > 2a) if gettext, XML files for all translations are loaded a .po is
> > > constructed for each and then we launch msgfmt against all .po's to get
> > > the .mo file
> > > 2b) otherwise we either leave the XML alone and parse that for each
> > > request OR we load it into some structure (similar to current array
> > > system)
> > >
> > > After all this I start wondering if gettext is so important it justifies
> > > the work. I mean, why not just to with the method in 2b? My answer,
> > > though I can't verify would be speed. I have to believe gettext is
> > > faster/more efficient.
> > >
> > >
> >
> > --
> > ------------------------------------------------------------------------|
> > 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 |
> > ------------------------------------------------------------------------|
> >
> > _______________________________________________
> > geeklog-devel mailing list
> > geeklog-devel at lists.geeklog.net
> > http://lists.geeklog.net/listinfo/geeklog-devel
>
>
>
> --
> Tom Willett
> tomw at pigstye.net
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-devel
>
--
------------------------------------------------------------------------|
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