From: Russ P. <ru...@ph...> - 2006-09-05 19:11:50
|
I've done a little bit of experimenting with gettext on Windows. The following couple of lines of code return a country and region code: s = locale.getdefaultlocale () print s[0] With the regional settings set to English (UK), this returns en_GB. With them set to English (US), it returns en_US. This all seems entirely logical ;-) My thinking for l10n files is to put them all in a "locale" directory (this includes gettext .mo files, localised help files, etc). My plan is that the program will first look for a file that exactly matches the locale returned by the above code. If such a file does not exist, then it will look for a file that matches the first part (en in this case), since that will probably be "good enough", if not ideal. An example may help to illustrate this. Suppose we have an en_GB.mo file (containing strings used in the application) and a en_GB.chm file (help file). These contain text in British English. If a user in the US were to use Panic Button, and there were no en_US.mo and en_US.chm files, then Panic Button would fall back to using en_GB.mo and en_GB.chm. This isn't ideal, since Americans spell various things slightly differently (I can't think of a relevant example, but "colour" in English is "color" in American). The spellings should be close enough that the user will be able to use the program without difficulty. The thing is, my knowledge of languages other than English is non-existant. I'm pretty sure that this would be fine in the English-speaking world, but I don't know about anywhere else. I imagine there are German and Austrian variants of German. Are they close enough that a speaker of one would have no difficulty if presented with an interface in the other language? Russ |
From: Russ P. <ru...@ph...> - 2006-09-08 08:54:11
|
On 08/09/06, Gerard Jensen <ger...@a2...> wrote: > Hi Russ, > > only got around checking my email today (talk about a *really* busy > schedule these days... ;-)) > > > My thinking for l10n files is to put them all in a "locale" directory > > (this includes gettext .mo files, localised help files, etc). My plan is > > that the program will first look for a file that exactly matches the > > locale returned by the above code. If such a file does not exist, then > > it will look for a file that matches the first part (en in this case), > > since that will probably be "good enough", if not ideal. > > I think that's a pretty good way of getting around the problem of > possibly having to provide multiple language versions (en_US, en_GB for > example) - but I think an even easier way would be to define English (in > your case obviously en_GB) as the "default" on which to fall back if no > other match can be found. > > After all, the installer probably supports more languages on > installation than PanicButton will support for quite some time, so if > someone chooses "Simplified Chinese" just for the fun of it, he should > still get something usable installed ;-) > > The same should apply if the .mo file can be found for a certain > language, but the .chm file can't: in that case fall back on the English > original. Translating the entire help file may after all seem a bit > daunting to some - so here you could provide a translation in two stages > then: first just the .po file, then some time later the helpfiles... I agree entirely. I had intended to say that in my original post, but obviously forgot :-) We need to choose a language to be the default language to use if the local language isn't available, and English seems a good choice, for two reasons: 1. The original, definitive, version is English - everything else is a derivative 2. Many people across the world speak English. I *think* it's the widest-known language, so there's a good chance that the user will be able to understand the messages, even if English is not their default language. > > The thing is, my knowledge of languages other than English is > > non-existant. I'm pretty sure that this would be fine in the > > English-speaking world, but I don't know about anywhere else. I imagine > > there are German and Austrian variants of German. Are they close enough > > that a speaker of one would have no difficulty if presented with an > > interface in the other language? > > Apart from minor spelling differences there may be the one or other > grammar difference too (especially now that Germany has chosen to work > with the NEW! IMPROVED! MORE BANG FOR YOUR BUCKS! kind of spelling), but > I'd assume that someone from Austria or Switzerland will still be quite > content to use the "normal" German - even more so, if the choice of > alternatives is rather limited (Swiss users may also prefer a French or > Italian version after all). > > And if they're not content with it - well, what a good motivation for > them to start a new localisation run, don't you think? ;-) We can hope ;-) Russ |