You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add empty translation files to the exported app bundle, to allow translation detection by the OS.
(cherry picked from commit 2eeff4caec)
This commit is contained in:
@@ -645,6 +645,24 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
|||||||
err = tmp_app_dir->make_dir_recursive(tmp_app_path_name + "/Contents/Resources");
|
err = tmp_app_dir->make_dir_recursive(tmp_app_path_name + "/Contents/Resources");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector<String> translations = ProjectSettings::get_singleton()->get("locale/translations");
|
||||||
|
if (translations.size() > 0) {
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < translations.size(); i++) {
|
||||||
|
Ref<Translation> tr = ResourceLoader::load(translations[i]);
|
||||||
|
if (tr.is_valid()) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now process our template.
|
// Now process our template.
|
||||||
bool found_binary = false;
|
bool found_binary = false;
|
||||||
Vector<String> dylibs_found;
|
Vector<String> dylibs_found;
|
||||||
|
|||||||
Reference in New Issue
Block a user