yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.01k stars 1.51k forks source link

Feature request: Reactivate Thai #11832

Open SomeTroglodyte opened 1 week ago

SomeTroglodyte commented 1 week ago

Problem Description

I believe Thai can be reactivated, with the upcoming diacritics support.

image

Looks pretty close to how a browser renders the same.

Related Issue Links

11806

1537 - yes that old. Last update to Thai I could find. @NoNZeeZ are you still with us after 5 years?

Desired Solution

patch that produced the screenshot above ```patch Subject: [PATCH] Create a load-predefined-game test that catches the 4.12.2 bug --- Index: core/src/com/unciv/models/translations/Translations.kt IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/core/src/com/unciv/models/translations/Translations.kt b/core/src/com/unciv/models/translations/Translations.kt --- a/core/src/com/unciv/models/translations/Translations.kt (revision c2c07b4ad04d21e4180884de2a9814d142a49fa5) +++ b/core/src/com/unciv/models/translations/Translations.kt (date 1719166802878) @@ -166,7 +166,6 @@ languages.remove("template") languages.remove("completionPercentages") - languages.remove("Thai") // Spacing looks horrible, so disable until we figure out what to do with it return languages.filter { Gdx.files.internal("jsons/translations/$it.properties").exists() } } Index: android/assets/jsons/translations/Thai.properties IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/android/assets/jsons/translations/Thai.properties b/android/assets/jsons/translations/Thai.properties --- a/android/assets/jsons/translations/Thai.properties (revision c2c07b4ad04d21e4180884de2a9814d142a49fa5) +++ b/android/assets/jsons/translations/Thai.properties (date 1719167711265) @@ -9,6 +9,18 @@ # Don't translate these words to your language, only put 'true' or 'false'. StartWithCapitalLetter = false +# Diacritics Support: +# Underlying libraries operate one character at a time, and with these you define where Unciv will create replacement codepoints with joined glyphs. +# Each one, including the range, can simply list codes one after the other or you can separate them with blanks when needed or for readability. +# If your language does not need these, feel free to ignore, or use "" to avoid the "requires translation" mark. +# Define the range of characters that can join: Supply exactly to characters. This is allowed to include the diacritics below, the actual set of "base" characters will exclude those automatically. +diacritics_joinable_range = ก ๛ +# List all codes meant to join with the character to the left of them: +left_joining_diacritics = ั ิ ี ึ ื ุ ู ฺ ็ ่ ้ ๊ ๋ ์ ํ ๎ +# List all codes meant to join with the character to the right of them: +right_joining_diacritics = "" +# List all codes meant to join with the character to the left AND with the character to the right: +left_and_right_joiners = "" # Starting from here normal translations start, as written on @@ -648,7 +660,7 @@ # Requires translation! Username = # Requires translation! -Multiplayer = +Multiplayer = ผู้เล่นหลายคน # Requires translation! Could not download game! = # Requires translation! @@ -774,7 +786,7 @@ # Options # Requires translation! -Options = +Options = ตัวเลือก # Requires translation! About = # Requires translation! @@ -1228,24 +1240,24 @@ # Requires translation! [year] AD = # Requires translation! -Civilopedia = +Civilopedia = พลเรือน # Requires translation! -Start new game = +Start new game = เริ่มเกมใหม่ # Requires translation! -Save game = +Save game = บันทึกเกม # Requires translation! -Load game = +Load game = โหลดเกมส์ # Requires translation! Main menu = # Requires translation! -Resume = +Resume = ประวัติย่อ # Requires translation! Cannot resume game! = # Requires translation! Not enough memory on phone to load game! = # Requires translation! -Quickstart = +Quickstart = เริ่มต้นอย่างรวดเร็ว # Requires translation! Cannot start game with the default new game parameters! = # Requires translation! @@ -1255,7 +1267,7 @@ # Requires translation! Community = # Requires translation! -Close = +Close = ปิด # Requires translation! Do you want to exit the game? = # Requires translation! @@ -1818,7 +1830,7 @@ # Requires translation! Tileset = # Requires translation! -Map editor = +Map editor = เครื่องมือแก้ไขแผนที่ # Requires translation! Create = # Requires translation! @@ -2196,7 +2208,7 @@ # Mods # Requires translation! -Mods = +Mods = ม็อด # Requires translation! Download [modName] = # Requires translation! Index: android/assets/jsons/translations/completionPercentages.properties IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/android/assets/jsons/translations/completionPercentages.properties b/android/assets/jsons/translations/completionPercentages.properties --- a/android/assets/jsons/translations/completionPercentages.properties (revision c2c07b4ad04d21e4180884de2a9814d142a49fa5) +++ b/android/assets/jsons/translations/completionPercentages.properties (date 1719166802894) @@ -31,6 +31,7 @@ Simplified_Chinese = 99 Spanish = 98 Swedish = 79 +Thai = 3 Traditional_Chinese = 91 Turkish = 98 Ukrainian = 99 ```

IOW: Remove the hardcoded exclusion from TFW (getLanguagesWithTranslationFile), add a completionPercentages.properties row so LanguagePicker finds it - and define the diacritics. Those are pure guesswork from https://www.unicode.org/charts/PDF/U0E00.pdf. Then I passed the main menu strings through machine translation so there is something to see, that's all.

Alternative Approaches

Ignore until we find a volunteer to actually maintain the translation

Additional Context

https://en.wikipedia.org/wiki/Thai_script

yairm210 commented 1 week ago

YES