aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/LoadLocalisation.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-10-28 11:40:07 +0200
committer hop311 <hop3114@gmail.com>2023-11-07 23:02:34 +0100
commit9304fd4e109c27a7dfb487a15c9a52c4055ee485 (patch)
tree01e3782174afc029310b87a1eb04f834267407ea /extension/src/openvic-extension/LoadLocalisation.cpp
parentd113649c115b687a30a2040161d8570907c9141b (diff)
Astyle formatting (with manual cleanup)
Diffstat (limited to 'extension/src/openvic-extension/LoadLocalisation.cpp')
-rw-r--r--extension/src/openvic-extension/LoadLocalisation.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/extension/src/openvic-extension/LoadLocalisation.cpp b/extension/src/openvic-extension/LoadLocalisation.cpp
index 418f01c..6ed92fd 100644
--- a/extension/src/openvic-extension/LoadLocalisation.cpp
+++ b/extension/src/openvic-extension/LoadLocalisation.cpp
@@ -101,8 +101,9 @@ Error LoadLocalisation::load_locale_dir(String const& dir_path, String const& lo
Error err = OK;
for (String const& file_name : files) {
if (file_name.get_extension().to_lower() == "csv") {
- if (_load_file_into_translation(dir_path.path_join(file_name), translation) != OK)
+ if (_load_file_into_translation(dir_path.path_join(file_name), translation) != OK) {
err = FAILED;
+ }
}
}
return err;
@@ -128,10 +129,11 @@ Error LoadLocalisation::load_localisation_dir(String const& dir_path) const {
}
Error err = OK;
for (String const& locale_name : dirs) {
- if (locale_name != server->standardize_locale(locale_name))
+ if (locale_name != server->standardize_locale(locale_name)) {
UtilityFunctions::push_error("Invalid locale directory name: ", locale_name);
- else if (load_locale_dir(dir_path.path_join(locale_name), locale_name) == OK)
+ } else if (load_locale_dir(dir_path.path_join(locale_name), locale_name) == OK) {
continue;
+ }
err = FAILED;
}
return err;
@@ -151,7 +153,8 @@ bool LoadLocalisation::add_message(std::string_view key, Dataloader::locale_t lo
if (0) {
const StringName old_localisation = translation->get_message(godot_key);
if (!old_localisation.is_empty()) {
- UtilityFunctions::push_warning("Changing translation ", godot_key, " (", Dataloader::locale_names[locale], ") from \"", old_localisation, "\" to \"", godot_localisation, "\"");
+ UtilityFunctions::push_warning("Changing translation ", godot_key, " (", Dataloader::locale_names[locale], ") from \"",
+ old_localisation, "\" to \"", godot_localisation, "\"");
}
}
translation->add_message(godot_key, godot_localisation);