From a65fc0e00c9bf213e60c18c0b73109b1b1af09e9 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 25 Aug 2020 17:15:42 +0300 Subject: [PATCH] Added Romanian and Korean --- Translations/Translations.pot | 3 +++ project.godot | 2 +- src/Preferences/HandleLanguages.gd | 12 +++++++++--- src/UI/Dialogs/AboutDialog.gd | 4 ++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Translations/Translations.pot b/Translations/Translations.pot index 85581633a..8a707f513 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -596,6 +596,9 @@ msgstr "" msgid "Hungarian" msgstr "" +msgid "Romanian" +msgstr "" + msgid "Development Team" msgstr "" diff --git a/project.godot b/project.godot index b0fece2ce..0e417d272 100644 --- a/project.godot +++ b/project.godot @@ -411,7 +411,7 @@ open_docs={ [locale] -translations=PoolStringArray( "res://Translations/zh_TW.po", "res://Translations/pt_BR.po", "res://Translations/de_DE.po", "res://Translations/el_GR.po", "res://Translations/en_US.po", "res://Translations/fr_FR.po", "res://Translations/it_IT.po", "res://Translations/pl_PL.po", "res://Translations/ru_RU.po", "res://Translations/es_ES.po", "res://Translations/zh_CN.po", "res://Translations/lv_LV.po", "res://Translations/eo_UY.po", "res://Translations/cs_CZ.po", "res://Translations/id_ID.po", "res://Translations/hu_HU.po" ) +translations=PoolStringArray( "res://Translations/zh_TW.po", "res://Translations/pt_BR.po", "res://Translations/de_DE.po", "res://Translations/el_GR.po", "res://Translations/en_US.po", "res://Translations/fr_FR.po", "res://Translations/it_IT.po", "res://Translations/pl_PL.po", "res://Translations/ru_RU.po", "res://Translations/es_ES.po", "res://Translations/zh_CN.po", "res://Translations/lv_LV.po", "res://Translations/eo_UY.po", "res://Translations/cs_CZ.po", "res://Translations/id_ID.po", "res://Translations/hu_HU.po", "res://Translations/ro_RO.po", "res://Translations/ko_KR.po" ) locale_filter=[ 0, [ ] ] [logging] diff --git a/src/Preferences/HandleLanguages.gd b/src/Preferences/HandleLanguages.gd index 2ed9f211c..72b63fa0b 100644 --- a/src/Preferences/HandleLanguages.gd +++ b/src/Preferences/HandleLanguages.gd @@ -19,6 +19,8 @@ const languages_dict := { "zh_TW" : ["繁體中文", "Chinese Traditional"], "no_NO" : ["Norsk", "Norwegian"], "hu_HU" : ["Magyar", "Hungarian"], + "ro_RO" : ["Romanian", "Romanian"], + "ko_KR" : ["한국어", "Korean"], } var loaded_locales : Array @@ -42,7 +44,7 @@ func _ready() -> void: button.hint_tooltip = languages_dict[locale][1] button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND button.group = button_group - if "zh" in locale: + if is_cjk(locale): button.add_font_override("font", cjk_font) add_child(button) @@ -58,7 +60,7 @@ func _ready() -> void: else: # If the user doesn't have a language preference, set it to their OS' locale TranslationServer.set_locale(OS.get_locale()) - if "zh" in TranslationServer.get_locale(): + if is_cjk(TranslationServer.get_locale()): Global.control.theme.default_font = preload("res://assets/fonts/CJK/NotoSansCJKtc-Regular.tres") else: Global.control.theme.default_font = preload("res://assets/fonts/Roboto-Regular.tres") @@ -76,7 +78,7 @@ func _on_Language_pressed(index : int) -> void: else: TranslationServer.set_locale(loaded_locales[index - 1]) - if "zh" in TranslationServer.get_locale(): + if is_cjk(TranslationServer.get_locale()): Global.control.theme.default_font = preload("res://assets/fonts/CJK/NotoSansCJKtc-Regular.tres") else: Global.control.theme.default_font = preload("res://assets/fonts/Roboto-Regular.tres") @@ -88,3 +90,7 @@ func _on_Language_pressed(index : int) -> void: Global.update_hint_tooltips() Global.preferences_dialog._on_PreferencesDialog_popup_hide() Global.preferences_dialog._on_PreferencesDialog_about_to_show(true) + + +func is_cjk(locale : String) -> bool: + return "zh" in locale or "ko" in locale diff --git a/src/UI/Dialogs/AboutDialog.gd b/src/UI/Dialogs/AboutDialog.gd index ce0a1a62f..fdd301409 100644 --- a/src/UI/Dialogs/AboutDialog.gd +++ b/src/UI/Dialogs/AboutDialog.gd @@ -101,6 +101,7 @@ func _on_AboutDialog_about_to_show() -> void: translators.create_item(translators_root).set_text(0, " StarFang208 - " + tr("Italian")) translators.create_item(translators_root).set_text(0, " Azagaya VJ (azagaya.games) - " + tr("Spanish")) translators.create_item(translators_root).set_text(0, " Lilly And (KatieAnd) - " + tr("Spanish")) + translators.create_item(translators_root).set_text(0, " UncleFangs - " + tr("Spanish")) translators.create_item(translators_root).set_text(0, " Jaime Arancibia Soto - " + tr("Spanish") + " " + tr("and") + " " + tr("Catalan")) translators.create_item(translators_root).set_text(0, " Agnis Aldiņš (NeZvers) - " + tr("Latvian")) translators.create_item(translators_root).set_text(0, " Teashrock - " + tr("Esperanto")) @@ -108,6 +109,9 @@ func _on_AboutDialog_about_to_show() -> void: translators.create_item(translators_root).set_text(0, " Martin Novák (novhack) - " + tr("Czech")) translators.create_item(translators_root).set_text(0, " Lullius - " + tr("Norwegian")) translators.create_item(translators_root).set_text(0, " Aninuscsalas - " + tr("Hungarian")) + translators.create_item(translators_root).set_text(0, " jaehyeon1090 - " + tr("Korean")) + translators.create_item(translators_root).set_text(0, " sfun_G - " + tr("Korean")) + translators.create_item(translators_root).set_text(0, " LMG - " + tr("Romanian")) func _on_AboutDialog_popup_hide() -> void: