Issue #7386: fix languages non-provided by InnoSetup showing as English.
The language files provided by the InnoSetup project (either the main ones or the "Unofficial" ones, i.e. less maintained ones) at least provides the name of the language, possibly in English, ideally self-localized in its own language. Unfortunately Kabyle didn't have any language file so we were using the Default one, which ended up showing the lang as a duplicate (and very wrong) "English". With this commit, I add code to provide our own very basic base language file, which would at least contain the language name. There is also a concept of language ID to be verified in Windows-provided list. Unfortunately it doesn't have any (actually it was id-ed 0x1000 like many other languages, which looked therefore to be the code for an unsupported lang). InnoSetup docs tells us to leave 0 then. We can add the ability to set a specific code later in the template if we add other un-provided languages and if they have their own lang id. With this base infrastructure, we should be able to better support more languages.
This commit is contained in:
parent
26d0c2083f
commit
47ba11056f
3 changed files with 32 additions and 2 deletions
|
|
@ -207,7 +207,7 @@ Name: "is"; MessagesFile: "compiler:Languages\Icelandic.isl,lang\is.setup.isl"
|
|||
Name: "it"; MessagesFile: "compiler:Languages\Italian.isl,lang\it.setup.isl"
|
||||
Name: "ja"; MessagesFile: "compiler:Languages\Japanese.isl,lang\ja.setup.isl"
|
||||
Name: "ka"; MessagesFile: "compiler:Languages\Unofficial\Georgian.isl,lang\ka.setup.isl"
|
||||
Name: "kab"; MessagesFile: "compiler:Default.isl,lang\kab.setup.isl"
|
||||
Name: "kab"; MessagesFile: "compiler:Default.isl,lang\kab.isl,lang\kab.setup.isl"
|
||||
Name: "ko"; MessagesFile: "compiler:Languages\Unofficial\Korean.isl,lang\ko.setup.isl"
|
||||
Name: "lt"; MessagesFile: "compiler:Languages\Unofficial\Lithuanian.isl,lang\lt.setup.isl"
|
||||
Name: "lv"; MessagesFile: "compiler:Languages\Unofficial\Latvian.isl,lang\lv.setup.isl"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ languages = [
|
|||
{ 'code': 'it', },
|
||||
{ 'code': 'ja', },
|
||||
{ 'code': 'ka', },
|
||||
{ 'code': 'kab', },
|
||||
{ 'code': 'kab', 'langname': 'Taqbaylit' },
|
||||
{ 'code': 'ko', },
|
||||
{ 'code': 'lt', },
|
||||
{ 'code': 'lv', },
|
||||
|
|
@ -105,6 +105,21 @@ foreach language : languages
|
|||
],
|
||||
build_by_default: true,
|
||||
)
|
||||
|
||||
if 'langname' in language
|
||||
# Some languages may have no default language file provided by
|
||||
# InnoSetup. When this happens, we must at least complete a very
|
||||
# basic file showing the language name, otherwise it shows as
|
||||
# "English".
|
||||
newlang_isl = '@0@.isl'.format(language.get('code'))
|
||||
newlang_conf = configuration_data()
|
||||
newlang_conf.set('LANGNAME', language.get('langname'))
|
||||
configure_file(
|
||||
input : 'newlang.isl.in',
|
||||
output : newlang_isl,
|
||||
configuration : newlang_conf
|
||||
)
|
||||
endif
|
||||
endforeach
|
||||
|
||||
test('windows-installer-langs',
|
||||
|
|
|
|||
15
build/windows/installer/lang/newlang.isl.in
Normal file
15
build/windows/installer/lang/newlang.isl.in
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
; A template to create the basic lang file for languages which are not
|
||||
; made available by InnoSetup, not even in the Unofficial/ folder.
|
||||
; See full list of languages:
|
||||
; https://github.com/jrsoftware/issrc/tree/main/Files/Languages
|
||||
;
|
||||
; Without this, they show as English in the
|
||||
; start list so we must add a language name (localized preferably) at
|
||||
; the very least.
|
||||
; See also the docs for the meanings of different fields:
|
||||
; https://jrsoftware.org/ishelp/index.php?topic=langoptionssection
|
||||
|
||||
[LangOptions]
|
||||
LanguageName=@LANGNAME@
|
||||
LanguageID=$0
|
||||
LanguageCodePage=0
|
||||
Loading…
Reference in a new issue