Skip to content

Commit

Permalink
i18n: Skip unsupported locales for editor translations
Browse files Browse the repository at this point in the history
Godot currently can't properly render scripts that require Right-To-Left
and font shaping support, so we skip those.
This is a temporary measure until these features are supported.

Fixes godotengine#28577.
  • Loading branch information
akien-mga committed May 21, 2019
1 parent 86f6d08 commit 92f67ce
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,27 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
String host_lang = OS::get_singleton()->get_locale();
host_lang = TranslationServer::standardize_locale(host_lang);

// Some locales are not properly supported currently in Godot due to lack of font shaping
// (e.g. Arabic or Hindi), so even though we have work in progress translations for them,
// we skip them as they don't render properly. (GH-28577)
const Vector<String> locales_to_skip = String("ar,bn,fa,he,hi,ml,si,ta,te,ur").split(",");

String best;

EditorTranslationList *etl = _editor_translations;

while (etl->data) {

const String &locale = etl->lang;

// Skip locales which we can't render properly (see above comment).
// Test against language code without regional variants (e.g. ur_PK).
String lang_code = locale.get_slice("_", 0);
if (locales_to_skip.find(lang_code) != -1) {
etl++;
continue;
}

lang_hint += ",";
lang_hint += locale;

Expand Down

0 comments on commit 92f67ce

Please sign in to comment.