OpenCandy expects 2-letter code, and can't have countries (e.g., "pt" is okay, "pt_br" is not). Also adding Japanese. Thanks to OC Partner Support.

This commit is contained in:
William Kendrick 2011-06-17 23:36:10 +00:00
parent a44b27a479
commit b827e062cb

View file

@ -316,13 +316,16 @@ begin
#endif #endif
end; end;
function Lang2Gettext(): String; function Lang2Gettext(TwoLetter: Boolean): String;
var var
lang, lc: String; lang, lc: String;
begin begin
lang := ActiveLanguage(); lang := ActiveLanguage();
if lang = 'bra' then if lang = 'bra' then
if TwoLetter = true then
lc := 'pt'
else
lc := 'pt_br' lc := 'pt_br'
else else
if lang = 'cat' then if lang = 'cat' then
@ -365,6 +368,9 @@ begin
lc := 'sk' lc := 'sk'
else else
if lang = 'chs' then if lang = 'chs' then
if TwoLetter = true then
lc := 'zh'
else
lc := 'zh_cn' lc := 'zh_cn'
else else
if lang = 'esp' then if lang = 'esp' then
@ -373,7 +379,13 @@ begin
if lang = 'gal' then if lang = 'gal' then
lc := 'gl' lc := 'gl'
else else
if lang = 'jpn' then
lc := 'ja'
else
if lang = 'cht' then if lang = 'cht' then
if TwoLetter = true then
lc := 'zh'
else
lc := 'zh_tw' lc := 'zh_tw'
else else
lc := 'en'; lc := 'en';
@ -386,7 +398,7 @@ begin
CreateTheWizardPages; CreateTheWizardPages;
end end
#ifdef OpenCandy #ifdef OpenCandy
OCtszInstallerLanguage := Lang2Gettext(); OCtszInstallerLanguage := Lang2Gettext(true);
OpenCandyAsyncInit('{#OC_STR_MY_PRODUCT_NAME}', '{#OC_STR_KEY}', '{#OC_STR_SECRET}', OCtszInstallerLanguage, {#OC_INIT_MODE_NORMAL}); OpenCandyAsyncInit('{#OC_STR_MY_PRODUCT_NAME}', '{#OC_STR_KEY}', '{#OC_STR_SECRET}', OCtszInstallerLanguage, {#OC_INIT_MODE_NORMAL});
#endif #endif
end; end;
@ -395,7 +407,7 @@ function MyReadme(Default: String): String;
var var
lang, readme: String; lang, readme: String;
begin begin
lang := Lang2Gettext(); lang := Lang2Gettext(false);
if lang = 'nl' then if lang = 'nl' then
readme := 'nl\html\README.html' readme := 'nl\html\README.html'