[Geany-devel] intltool usage question
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.
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
A good name for cfile might be buildmenutranslate.h
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
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
It uses grep to speed its file search by eliminating lots of files (hopefully)
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.
>> Geany-devel mailing list
>> Geany-devel at uvena.de
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2001 bytes
Desc: not available
More information about the Devel