[Geany-devel] intltool usage question

Lex Trotman elextr at xxxxx
Thu Aug 27 14:17:22 UTC 2009


Hi Nick, Enrico, Frank,

As I understand it intltool handles config files by creating a C file
with their strings that can be processed with the other code, and then
updates the config files with the translations from the .po files.

Inspired by this here is a 50 line python script to do this for build
menu entries in filetypes files.

run as:
xbuildmenu.py mkc cfile list_of_filetypes_files..

it creates the file cfile as a C file with strings containing all the
build menu labels it finds in the listed filetypes files (filetypes.*
would be good:-)
this cfile can be processed by your translation tools (tested with
xgettext) along with all the other program files to extract strings
for translation.
A good name for cfile might be buildmenutranslate.h

run as:
xbuildmenu.py upd cfile podir

it searches the po files in podir for strings taken from the cfile and
using the information in the structured comments in the cfile copies
the translation back into the filetypes files with a language marker
the same as the po file name, eg de.po gives [de] on the config file
entry.

It should be easy to call this from the waf script since you are
guaranteed that python is available :-).  We are only talking about
the standard filetypes as delivered with the system so there is no
need for users to run this, just run when translations are updated in
svn.

It uses grep to speed its file search by eliminating lots of files (hopefully)

Cheers
Lex

2009/8/26 Lex Trotman <elextr at gmail.com>:
> 2009/8/26 Nick Treleaven <nick.treleaven at btinternet.com>:
>>
>> Yes, but any default string could be added to the codebase for
>> translations, not just compile and build. Assuming it's a 'general'
>> kind of menu label, things which would be useful for several filetypes.
>>
>
> All the strings in the code that appear as labels should already be
> marked for translation, if I missed any thats a bug :-)
>
> There isn't any way of changing the default label string to a
> different default depending on filetype.  The intention is that if you
> want to change a filetype menu label it is configured in the filetypes
> file along with the command and overrides the default.
>
> Let me look at a possible solution in a few days.
>
> Cheers
> Lex
>
>> Regards,
>> Nick
>> _______________________________________________
>> Geany-devel mailing list
>> Geany-devel at uvena.de
>> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xbuildmenu.py
Type: text/x-python
Size: 2001 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20090828/4022a601/attachment.py>


More information about the Devel mailing list