Recent

Author Topic: i18n language code issue  (Read 198 times)

tongming

  • Newbie
  • Posts: 2
i18n language code issue
« on: March 30, 2020, 10:53:22 am »
I am doing i18n, I prepared everything from the link https://wiki.freepascal.org/Translations_/_i18n_/_localizations_for_programs .
And I set the different languages po files with the code from https://wiki.freepascal.org/Language_Codes.
The list said Chinese is "zh" or "zh-cn", however, I get the locale is "ch" by the code

Code: Pascal  [Select][+][-]
  1. function GetOSLanguage: string;
  2. var
  3.   lang, fallbacklang: string;
  4. begin
  5.   GetLanguageIDs(lang, fallbacklang);
  6.   Result := fallbacklang;
  7. end;
  8.  

Is anything I did wrong?

lucamar

  • Hero Member
  • *****
  • Posts: 2926
Re: i18n language code issue
« Reply #1 on: March 30, 2020, 11:04:07 am »
What does lang contains? That's the "real" language code; fallbacklang is only the one used if lang isn't set.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.8/FPC 3.0.4 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

tongming

  • Newbie
  • Posts: 2
Re: i18n language code issue
« Reply #2 on: March 30, 2020, 11:41:17 am »
What does lang contains? That's the "real" language code; fallbacklang is only the one used if lang isn't set.

lang return ch_CH
fallback return ch.

both are "wrong".

 

TinyPortal © 2005-2018