1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Updated Translation architecture to have TranslationPO, did some commit fixes and updated class Reference.

This commit is contained in:
SkyJJ
2020-08-07 13:17:12 +02:00
parent 396f2eee82
commit 0ef758eaee
17 changed files with 599 additions and 305 deletions

View File

@@ -1432,7 +1432,7 @@ void Object::initialize_class() {
initialized = true;
}
StringName Object::tr(const StringName &p_message, const StringName &p_context) const {
String Object::tr(const StringName &p_message, const StringName &p_context) const {
if (!_can_translate || !TranslationServer::get_singleton()) {
return p_message;
}
@@ -1444,9 +1444,8 @@ String Object::tr_n(const StringName &p_message, const StringName &p_message_plu
// Return message based on English plural rule if translation is not possible.
if (p_n == 1) {
return p_message;
} else {
return p_message_plural;
}
return p_message_plural;
}
return TranslationServer::get_singleton()->translate_plural(p_message, p_message_plural, p_n, p_context);
}