diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-01 10:14:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-01 10:14:11 +0200 |
commit | 536f6a1472b27aa88b5226404fdb30898cc98576 (patch) | |
tree | fdb395cd9c06707c07ea17ccb5761f2b3ebce45c /editor | |
parent | 007b877cb73cd6b60c86eb7b02d4e6f1cee409ea (diff) | |
parent | fb07cc88326a5709a60a6e48a6770f1860be2f97 (diff) |
Merge pull request #51124 from YeldhamDev/local_editor_dup_fix
Fix being able to add duplicate files in the Localization editor
Diffstat (limited to 'editor')
-rw-r--r-- | editor/localization_editor.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index b32ea67d4d..3fe1aa557d 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -371,15 +371,10 @@ void LocalizationEditor::_translation_filter_mode_changed(int p_mode) { void LocalizationEditor::_pot_add(const PackedStringArray &p_paths) { PackedStringArray pot_translations = ProjectSettings::get_singleton()->get("internationalization/locale/translations_pot_files"); - for (int i = 0; i < p_paths.size(); i++) { - for (int j = 0; j < pot_translations.size(); j++) { - if (pot_translations[j] == p_paths[i]) { - continue; //exists - } + if (!pot_translations.has(p_paths[i])) { + pot_translations.push_back(p_paths[i]); } - - pot_translations.push_back(p_paths[i]); } undo_redo->create_action(vformat(TTR("Add %d file(s) for POT generation"), p_paths.size())); |