[macOS and iOS export] Add localized application name to the translation .plist files.

This commit is contained in:
bruvzg
2022-03-04 09:27:44 +02:00
parent d0c3094da8
commit 5fdea69276
4 changed files with 62 additions and 0 deletions

View File

@ -787,6 +787,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
String fname = tmp_app_path_name + "/Contents/Resources/en.lproj";
tmp_app_dir->make_dir_recursive(fname);
FileAccessRef f = FileAccess::open(fname + "/InfoPlist.strings", FileAccess::WRITE);
f->store_line("CFBundleDisplayName = \"" + ProjectSettings::get_singleton()->get("application/config/name").operator String() + "\";");
}
for (const String &E : translations) {
@ -795,6 +796,10 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
String fname = tmp_app_path_name + "/Contents/Resources/" + tr->get_locale() + ".lproj";
tmp_app_dir->make_dir_recursive(fname);
FileAccessRef f = FileAccess::open(fname + "/InfoPlist.strings", FileAccess::WRITE);
String prop = "application/config/name_" + tr->get_locale();
if (ProjectSettings::get_singleton()->has_setting(prop)) {
f->store_line("CFBundleDisplayName = \"" + ProjectSettings::get_singleton()->get(prop).operator String() + "\";");
}
}
}
}