[fpc-devel] GetText's GetLanguageIDs()

Graeme Geldenhuys graemeg.lists at gmail.com
Sat Mar 1 15:45:35 CET 2008


On 01/03/2008, Giuliano Colla <giuliano.colla at fastwebnet.it> wrote:
>
>  The top, for maximum flexibility wold be: if there's a full match use
>  it, if not find a match with the characters up to "_". So, if you have
>  fpgui.en_US.po, fpgui.en_GB.po, an user from Canada or from Australia
>  (en_CA, en_AU) will still have an English translation (GB or US, the

I already do this. The following example explains the English language search.

 1) Look for files like "fpgui.en_XX.po". At the moment I strip the
last ".UTF-8" part. Actually anything from the "." onwards
(en_ZA.UTF-8  ->  en_ZA).
 2) If no match found, strip everything from the "_" onwards (en_ZA
->  en), which leaves the file "fpgui.en.po"
 3) If still no match, then default to the default fpGUI language
specified by the developer. English in my case.

>  .... but on Windows, if you use the full qualifier, you're
>  forced to duplicate a lot of files (de_AT,de_DE,de_CH, or
>  fr_FR,fr_CA,fr_CH, etc.).

Using your example, fpGUI would search for the full qualifiers first.
If no match found, then 'de' or 'fr' will be searched, otherwise
default to the language specified by the developer.

Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list