summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export.cpp61
-rw-r--r--platform/osx/joypad_osx.cpp3
-rw-r--r--platform/windows/detect.py2
3 files changed, 34 insertions, 32 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 956b59ce80..1795bbe523 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1817,12 +1817,12 @@ public:
MutexLock lock(device_lock);
- EditorProgress ep("run", "Running on " + devices[p_device].name, 3);
+ EditorProgress ep("run", vformat(TTR("Running on %s"), devices[p_device].name), 3);
String adb = get_adb_path();
// Export_temp APK.
- if (ep.step("Exporting APK...", 0)) {
+ if (ep.step(TTR("Exporting APK..."), 0)) {
return ERR_SKIP;
}
@@ -1857,7 +1857,7 @@ public:
String package_name = p_preset->get("package/unique_name");
if (remove_prev) {
- if (ep.step("Uninstalling...", 1)) {
+ if (ep.step(TTR("Uninstalling..."), 1)) {
CLEANUP_AND_RETURN(ERR_SKIP);
}
@@ -1874,7 +1874,7 @@ public:
}
print_line("Installing to device (please wait...): " + devices[p_device].name);
- if (ep.step("Installing to device, please wait...", 2)) {
+ if (ep.step(TTR("Installing to device, please wait..."), 2)) {
CLEANUP_AND_RETURN(ERR_SKIP);
}
@@ -1889,7 +1889,7 @@ public:
err = OS::get_singleton()->execute(adb, args, &output, &rv, true);
print_verbose(output);
if (err || rv != 0) {
- EditorNode::add_io_error("Could not install to device: " + output);
+ EditorNode::add_io_error(vformat(TTR("Could not install to device: %s"), output));
CLEANUP_AND_RETURN(ERR_CANT_CREATE);
}
@@ -1945,7 +1945,7 @@ public:
}
}
- if (ep.step("Running on device...", 3)) {
+ if (ep.step(TTR("Running on device..."), 3)) {
CLEANUP_AND_RETURN(ERR_SKIP);
}
args.clear();
@@ -1967,7 +1967,7 @@ public:
err = OS::get_singleton()->execute(adb, args, &output, &rv, true);
print_verbose(output);
if (err || rv != 0) {
- EditorNode::add_io_error("Could not execute on device.");
+ EditorNode::add_io_error(TTR("Could not execute on device."));
CLEANUP_AND_RETURN(ERR_CANT_CREATE);
}
@@ -2068,6 +2068,8 @@ public:
if (!installed_android_build_template) {
r_missing_templates = !exists_export_template("android_source.zip", &err);
err += TTR("Android build template not installed in the project. Install it from the Project menu.") + "\n";
+ } else {
+ r_missing_templates = false;
}
valid = installed_android_build_template && !r_missing_templates;
@@ -2324,7 +2326,7 @@ public:
String apksigner = get_apksigner_path();
print_verbose("Starting signing of the " + export_label + " binary using " + apksigner);
if (!FileAccess::exists(apksigner)) {
- EditorNode::add_io_error("'apksigner' could not be found.\nPlease check the command is available in the Android SDK build-tools directory.\nThe resulting " + export_label + " is unsigned.");
+ EditorNode::add_io_error(vformat(TTR("'apksigner' could not be found.\nPlease check the command is available in the Android SDK build-tools directory.\nThe resulting %s is unsigned."), export_label));
return OK;
}
@@ -2342,7 +2344,7 @@ public:
user = EditorSettings::get_singleton()->get("export/android/debug_keystore_user");
}
- if (ep.step("Signing debug " + export_label + "...", 104)) {
+ if (ep.step(vformat(TTR("Signing debug %s..."), export_label), 104)) {
return ERR_SKIP;
}
@@ -2351,13 +2353,13 @@ public:
password = release_password;
user = release_username;
- if (ep.step("Signing release " + export_label + "...", 104)) {
+ if (ep.step(vformat(TTR("Signing release %s..."), export_label), 104)) {
return ERR_SKIP;
}
}
if (!FileAccess::exists(keystore)) {
- EditorNode::add_io_error("Could not find keystore, unable to export.");
+ EditorNode::add_io_error(TTR("Could not find keystore, unable to export."));
return ERR_FILE_CANT_OPEN;
}
@@ -2381,11 +2383,11 @@ public:
OS::get_singleton()->execute(apksigner, args, &output, &retval, true);
print_verbose(output);
if (retval) {
- EditorNode::add_io_error("'apksigner' returned with error #" + itos(retval));
+ EditorNode::add_io_error(vformat(TTR("'apksigner' returned with error #%d"), retval));
return ERR_CANT_CREATE;
}
- if (ep.step("Verifying " + export_label + "...", 105)) {
+ if (ep.step(vformat(TTR("Verifying %s..."), export_label), 105)) {
return ERR_SKIP;
}
@@ -2401,7 +2403,7 @@ public:
OS::get_singleton()->execute(apksigner, args, &output, &retval, true);
print_verbose(output);
if (retval) {
- EditorNode::add_io_error("'apksigner' verification of " + export_label + " failed.");
+ EditorNode::add_io_error(vformat(TTR("'apksigner' verification of %s failed."), export_label));
return ERR_CANT_CREATE;
}
@@ -2464,7 +2466,7 @@ public:
String src_apk;
Error err;
- EditorProgress ep("export", "Exporting for Android", 105, true);
+ EditorProgress ep("export", TTR("Exporting for Android"), 105, true);
bool use_custom_build = bool(p_preset->get("custom_template/use_custom_build"));
bool p_give_internet = p_flags & (DEBUG_FLAG_DUMB_CLIENT | DEBUG_FLAG_REMOTE_DEBUG);
@@ -2513,7 +2515,7 @@ public:
return ERR_UNCONFIGURED;
}
if (export_format > EXPORT_FORMAT_AAB || export_format < EXPORT_FORMAT_APK) {
- EditorNode::add_io_error("Unsupported export format!\n");
+ EditorNode::add_io_error(TTR("Unsupported export format!\n"));
return ERR_UNCONFIGURED; //TODO: is this the right error?
}
@@ -2543,7 +2545,7 @@ public:
String project_name = get_project_name(p_preset->get("package/name"));
err = _create_project_name_strings_files(p_preset, project_name); //project name localization.
if (err != OK) {
- EditorNode::add_io_error("Unable to overwrite res://android/build/res/*.xml files with project name");
+ EditorNode::add_io_error(TTR("Unable to overwrite res://android/build/res/*.xml files with project name"));
}
// Copies the project icon files into the appropriate Gradle project directory.
_copy_icons_to_gradle_project(p_preset, processed_splash_config_xml, splash_image, splash_bg_color_image, main_image, foreground, background);
@@ -2559,7 +2561,7 @@ public:
user_data.debug = p_debug;
err = export_project_files(p_preset, rename_and_store_file_in_gradle_project, &user_data, copy_gradle_so);
if (err != OK) {
- EditorNode::add_io_error("Could not export project files to gradle project\n");
+ EditorNode::add_io_error(TTR("Could not export project files to gradle project\n"));
return err;
}
if (user_data.libs.size() > 0) {
@@ -2572,7 +2574,7 @@ public:
print_verbose("Saving apk expansion file..");
err = save_apk_expansion_file(p_preset, p_path);
if (err != OK) {
- EditorNode::add_io_error("Could not write expansion package file!");
+ EditorNode::add_io_error(TTR("Could not write expansion package file!"));
return err;
}
}
@@ -2659,7 +2661,7 @@ public:
String release_username = p_preset->get("keystore/release_user");
String release_password = p_preset->get("keystore/release_password");
if (!FileAccess::exists(release_keystore)) {
- EditorNode::add_io_error("Could not find keystore, unable to export.");
+ EditorNode::add_io_error(TTR("Could not find keystore, unable to export."));
return ERR_FILE_CANT_OPEN;
}
@@ -2723,7 +2725,7 @@ public:
src_apk = find_export_template("android_release.apk");
}
if (src_apk == "") {
- EditorNode::add_io_error("Package not found: " + src_apk);
+ EditorNode::add_io_error(vformat(TTR("Package not found: %s"), src_apk));
return ERR_FILE_NOT_FOUND;
}
}
@@ -2735,13 +2737,13 @@ public:
FileAccess *src_f = nullptr;
zlib_filefunc_def io = zipio_create_io_from_file(&src_f);
- if (ep.step("Creating APK...", 0)) {
+ if (ep.step(TTR("Creating APK..."), 0)) {
return ERR_SKIP;
}
unzFile pkg = unzOpen2(src_apk.utf8().get_data(), &io);
if (!pkg) {
- EditorNode::add_io_error("Could not find template APK to export:\n" + src_apk);
+ EditorNode::add_io_error(vformat(TTR("Could not find template APK to export:\n%s"), src_apk));
return ERR_FILE_NOT_FOUND;
}
@@ -2869,12 +2871,11 @@ public:
if (!invalid_abis.is_empty()) {
String unsupported_arch = String(", ").join(invalid_abis);
- EditorNode::add_io_error("Missing libraries in the export template for the selected architectures: " + unsupported_arch + ".\n" +
- "Please build a template with all required libraries, or uncheck the missing architectures in the export preset.");
+ EditorNode::add_io_error(vformat(TTR("Missing libraries in the export template for the selected architectures: %s.\nPlease build a template with all required libraries, or uncheck the missing architectures in the export preset."), unsupported_arch));
CLEANUP_AND_RETURN(ERR_FILE_NOT_FOUND);
}
- if (ep.step("Adding files...", 1)) {
+ if (ep.step(TTR("Adding files..."), 1)) {
CLEANUP_AND_RETURN(ERR_SKIP);
}
err = OK;
@@ -2888,7 +2889,7 @@ public:
if (apk_expansion) {
err = save_apk_expansion_file(p_preset, p_path);
if (err != OK) {
- EditorNode::add_io_error("Could not write expansion package file!");
+ EditorNode::add_io_error(TTR("Could not write expansion package file!"));
return err;
}
} else {
@@ -2901,7 +2902,7 @@ public:
if (err != OK) {
unzClose(pkg);
- EditorNode::add_io_error("Could not export project files");
+ EditorNode::add_io_error(TTR("Could not export project files"));
CLEANUP_AND_RETURN(ERR_SKIP);
}
@@ -2931,13 +2932,13 @@ public:
// If we're not signing the apk, then the next step should be the last.
const int next_step = should_sign ? 103 : 105;
- if (ep.step("Aligning APK...", next_step)) {
+ if (ep.step(TTR("Aligning APK..."), next_step)) {
CLEANUP_AND_RETURN(ERR_SKIP);
}
unzFile tmp_unaligned = unzOpen2(tmp_unaligned_path.utf8().get_data(), &io);
if (!tmp_unaligned) {
- EditorNode::add_io_error("Could not unzip temporary unaligned APK.");
+ EditorNode::add_io_error(TTR("Could not unzip temporary unaligned APK."));
CLEANUP_AND_RETURN(ERR_FILE_NOT_FOUND);
}
diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp
index 126ebc1908..d778271350 100644
--- a/platform/osx/joypad_osx.cpp
+++ b/platform/osx/joypad_osx.cpp
@@ -286,8 +286,9 @@ bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) {
}
if ((!refCF) || (!CFStringGetCString((CFStringRef)refCF, c_name, sizeof(c_name), kCFStringEncodingUTF8))) {
name = "Unidentified Joypad";
+ } else {
+ name = c_name;
}
- name = c_name;
int id = input->get_unused_joy_id();
ERR_FAIL_COND_V(id == -1, false);
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index a94f38583c..287ece1d29 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -152,7 +152,7 @@ def setup_msvc_auto(env):
env["TARGET_ARCH"] = None
if env["bits"] != "default":
env["TARGET_ARCH"] = {"32": "x86", "64": "x86_64"}[env["bits"]]
- if env.has_key("msvc_version"):
+ if "msvc_version" in env:
env["MSVC_VERSION"] = env["msvc_version"]
env.Tool("msvc")
env.Tool("mssdk") # we want the MS SDK