mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Allow localizing the application name with project translations
This commit is contained in:
parent
6fd949a6dc
commit
b8a8f8b35a
12 changed files with 100 additions and 57 deletions
|
|
@ -611,7 +611,10 @@ void TranslationServer::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::Type::BOOL, "pseudolocalization_enabled"), "set_pseudolocalization_enabled", "is_pseudolocalization_enabled");
|
||||
}
|
||||
|
||||
void TranslationServer::load_translations() {
|
||||
void TranslationServer::load_project_translations(Ref<TranslationDomain> p_domain) {
|
||||
DEV_ASSERT(p_domain.is_valid());
|
||||
|
||||
p_domain->clear();
|
||||
const String prop = "internationalization/locale/translations";
|
||||
if (!ProjectSettings::get_singleton()->has_setting(prop)) {
|
||||
return;
|
||||
|
|
@ -620,7 +623,7 @@ void TranslationServer::load_translations() {
|
|||
for (const String &path : translations) {
|
||||
Ref<Translation> tr = ResourceLoader::load(path);
|
||||
if (tr.is_valid()) {
|
||||
add_translation(tr);
|
||||
p_domain->add_translation(tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue