Re: [Bashburn-info] Gettext support
Brought to you by:
bashburn
|
From: Markus K. <mar...@on...> - 2008-09-11 01:47:03
|
Steven W. Orr wrote: > On Wednesday, Sep 10th 2008 at 15:39 -0000, quoth Markus Kollmar: > > =>Hm, I have just began some weeks before to check/playing and learning to > =>do gettext for bashburn. > =>I stoped the work, because I thought it is a great thing, but one must > =>have support for gettext in the lib's of the system. > =>And I was not shure whether it would be worth for us to do - I thought > =>at first the priority to improve bashburn functionality would be more > =>interesting for the most. > => > =>But I see now the discussion here, which is interesting. What do the > =>others think? Should we rely that a bashburn user has/need i18n > =>(internationalization) support? > => > =>If the most agree to use gettext, i can start working and experimenting > =>and to find out a strategy we can best implement gettext in bashburn, if > =>it is wished. > > I took a look at how this might look. > > A po file is a single language mapping file. So you need multiple po > files, one file per language. Then using gettext() you can translate from > English to whatever foreign language you want based on the setlocale() > language setting. (This means that BBLANG would just go away.) > > Note that the po files are generated from (I think) the pot files. IOW, > the pot files are src code and the po files are the result of a Makefile. > > So in your bashcode you might have something like: > > printf $(gettext "Hello, %s, you have %d messages waiting.\n" \ > name msgs) > > and then your po file would contain the mapping of this string to the > language specific translations. For example es.po would contain: > > #: ../src/foo.c:244 > msgid "Hello, %s, you have %d messages waiting.\n" > msgstr "Hola %s, usted tiene esperar de %d mensajes.\n" > > Your question about lib support is a non-issue. Literally every system has > all of the support needed. The part that I'm not yet comfortable with is > the idea of whether this is of value in a shell script since these > utilities were designed originally for C code. My feeling is that this is > not a problem, but since I've never been wrong before, it's bound to > happen sometime. ;-) > > Markus, since you've actually looked at this before, can you take a stab > at implementing a HelloWorld.sh? > > Ok, I will try. Please wait. Markus |