[GRASS-dev] i.tasscap translation- Scripts
Glynn Clements
glynn at gclements.plus.com
Thu Jan 28 15:50:32 EST 2010
Markus Neteler wrote:
> > Should g.parser be updated to allow the translation domain to be
> > specified?
>
> I think yes.
>
> > Currently, it uses "grassmods" (g.parser itself is a module), but that
> > means that anyone wanting to translate a custom script has to merge
> > their translations into the grasssmods_*.po files.
>
> It would be pretty nice to separate the "main" GRASS part from user
> customization also for the translations.
>
> > It might be useful to allow this to be overridden via e.g. an
> > environment variable (adding command-line options to g.parser is
> > tricky), so that individual scripts could use a different domain.
>
> Sounds good to me and I volunteer to make tests then.
r40727 and r40728 allow the translation domain to be specified via
GRASS_TRANSLATION_DOMAIN, e.g. (shell):
GRASS_TRANSLATION_DOMAIN=myscript
export GRASS_TRANSLATION_DOMAIN
if [ "$1" != "@ARGS_PARSED@" ] ; then
exec g.parser "$0" "$@"
fi
or (Python):
if __name__ == "__main__":
os.environ['GRASS_TRANSLATION_DOMAIN'] = 'myscript'
options, flags = grass.parser()
main()
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list