[geeklog-devel] Updating language files

Dirk Haun dirk at haun-online.de
Tue Apr 29 15:00:52 EDT 2008

Those of you following the CVS commits may have seen me working on that
script I use to update the Geeklog language files. I actually wrote this
years ago to copy texts that were added to the English language file
over to the translations. That way, you would have at least have an
English text there.

Over the last couple of days, I have now finally changed it so that it
can also update plugin language files. And so it's no longer restricted
to Geeklog's core code but may also be of interest to other plugin authors.

I've translated the occasional plugin language file over the years and
was always somewhat frustrated when there was an update and the author
had added new texts all over the place. It can be a real pain to track
all those changes down and on more than one occasion, I actually found
it easier to just start over fresh. Maybe plugin authors could consider
using this to make the translator's lives a little bit easier?

The tool is still crude, but it does what it's supposed to do:

  php lm.php language-file [module-name] > new-language-file


  php lm.php spanish.php calendar > spanish-updated.php

So the "module-name", if not empty, refers to the plugin and it expects
an include file of that name in the include directory that tells it what
to do. The lm.php (can't even remember what the 'm' stands for -
"merge", probably) provides functions to merge the arrays from
english.php and the specified language file and also takes care of
variables, proper quoting, etc.

Have a look:


bye, Dirk


More information about the geeklog-devel mailing list