1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-03 11:50:27 +00:00

Merge pull request #109802 from oxeron/fix_pot_files_not_updated

Update POT files when a file is moved or deleted
This commit is contained in:
Thaddeus Crews
2025-10-23 15:33:51 -05:00

View File

@@ -426,6 +426,17 @@ void LocalizationEditor::connect_filesystem_dock_signals(FileSystemDock *p_fs_do
}
void LocalizationEditor::_filesystem_files_moved(const String &p_old_file, const String &p_new_file) {
// Update POT files if the moved file is a part of them.
PackedStringArray pot_translations = GLOBAL_GET("internationalization/locale/translations_pot_files");
if (pot_translations.has(p_old_file)) {
pot_translations.erase(p_old_file);
ProjectSettings::get_singleton()->set_setting("internationalization/locale/translations_pot_files", pot_translations);
PackedStringArray new_file;
new_file.push_back(p_new_file);
_pot_add(new_file);
}
// Update remaps if the moved file is a part of them.
Dictionary remaps;
bool remaps_changed = false;
@@ -477,6 +488,13 @@ void LocalizationEditor::_filesystem_files_moved(const String &p_old_file, const
}
void LocalizationEditor::_filesystem_file_removed(const String &p_file) {
// Check if the POT files are affected.
PackedStringArray pot_translations = GLOBAL_GET("internationalization/locale/translations_pot_files");
if (pot_translations.has(p_file)) {
pot_translations.erase(p_file);
ProjectSettings::get_singleton()->set_setting("internationalization/locale/translations_pot_files", pot_translations);
}
// Check if the remaps are affected.
Dictionary remaps;