diff options
| author | Rémi Verschelde | 2018-02-14 18:49:27 +0100 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-02-19 22:27:19 +0100 |
| commit | 57f707f951faff7c6d27be4d8fffcc59b236a6fa (patch) | |
| tree | ed6925c857bb81887d6245b2fccb97760a8dc0b4 /core/translation.cpp | |
| parent | 2f87e7ffe97d5e290a107b3ddfef961f4d71ee17 (diff) | |
| download | godot-57f707f951faff7c6d27be4d8fffcc59b236a6fa.tar.gz godot-57f707f951faff7c6d27be4d8fffcc59b236a6fa.tar.zst godot-57f707f951faff7c6d27be4d8fffcc59b236a6fa.zip | |
Add locale renames for Hebrew and Indonesian on Windows
Windows does not fully respect ISO 639-1 like other systems,
so we have to override its locale values for those languages.
Also added comments to document the locale provenance.
(cherry picked from commit 0c7bed45c49b19bf49b2f2f462937fe14b26c3bb)
Diffstat (limited to '')
| -rw-r--r-- | core/translation.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/core/translation.cpp b/core/translation.cpp index 32096d2ea..aaa4de591 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -34,6 +34,14 @@ #include "os/os.h" #include "project_settings.h" +// ISO 639-1 language codes, with the addition of glibc locales with their +// regional identifiers. This list must match the language names (in English) +// of locale_names. +// +// References: +// - https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes +// - https://lh.2xlibre.net/locales/ + static const char *locale_list[] = { "aa", // Afar "aa_DJ", // Afar (Djibouti) @@ -756,8 +764,17 @@ static const char *locale_names[] = { 0 }; +// Windows has some weird locale identifiers which do not honor the ISO 639-1 +// standardized nomenclature. Whenever those don't conflict with existing ISO +// identifiers, we override them. +// +// Reference: +// - https://msdn.microsoft.com/en-us/library/windows/desktop/ms693062(v=vs.85).aspx + static const char *locale_renames[][2] = { - { "no", "nb" }, + { "in", "id" }, // Indonesian + { "iw", "he" }, // Hebrew + { "no", "nb" }, // Norwegian Bokmål { NULL, NULL } }; |
