mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
ResourceLoader: Add language code matching for localized resources
Near matching was not implemented like in TranslationServer, so a resource remapped for 'ru' (but not 'ru_RU') would not be used as fallback if the system locale was 'ru_RU'. Fixes #34058.
This commit is contained in:
@@ -1065,6 +1065,9 @@ StringName TranslationServer::translate(const StringName &p_message) const {
|
||||
// form. If not found, we fall back to a near match (another locale with
|
||||
// same language code).
|
||||
|
||||
// Note: ResourceLoader::_path_remap reproduces this locale near matching
|
||||
// logic, so be sure to propagate changes there when changing things here.
|
||||
|
||||
StringName res;
|
||||
String lang = get_language_code(locale);
|
||||
bool near_match = false;
|
||||
|
||||
Reference in New Issue
Block a user