Fixed renaming a string key not marking files as changed

This commit is contained in:
Marc Gilleron 2020-06-14 20:10:44 +01:00
parent 5b725d0d15
commit 3cdfde5f28

View File

@ -50,6 +50,7 @@ var _translation_edits := {}
var _dialogs_to_free_on_exit := []
var _logger = Logger.get_for(self)
# {stringID => {language => text}}
var _data := {}
var _languages := []
var _current_path := ""
@ -477,16 +478,24 @@ func add_new_string(strid: String):
"comments": ""
}
_data[strid] = s
_string_list.add_item(strid)
for language in _languages:
_set_language_modified(language)
# Update UI
_string_list.add_item(strid)
func rename_string(old_strid: String, new_strid: String):
assert(_data.has(old_strid))
var s : Dictionary = _data[old_strid]
_data.erase(old_strid)
_data[new_strid] = s
for language in _languages:
_set_language_modified(language)
# Update UI
for i in _string_list.get_item_count():
if _string_list.get_item_text(i) == old_strid:
_string_list.set_item_text(i, new_strid)