mirror of
https://github.com/Relintai/godot_translation_editor.git
synced 2025-03-17 07:16:21 +01:00
Use underscore on private functions
This commit is contained in:
parent
aa58a7e424
commit
ce879a3206
@ -244,7 +244,7 @@ func _process_gd(f: File, fpath: String):
|
||||
# No quote found in entire line, skip
|
||||
break
|
||||
|
||||
var end_quote_index := find_unescaped_quote(line, begin_quote_index + 1)
|
||||
var end_quote_index := _find_unescaped_quote(line, begin_quote_index + 1)
|
||||
if end_quote_index == -1:
|
||||
# Multiline or procedural strings not supported
|
||||
_logger.error("End quote not found in {0}, line {1}".format([fpath, line_number]))
|
||||
@ -282,7 +282,7 @@ func _process_quoted_text_generic(f: File, fpath: String):
|
||||
break
|
||||
|
||||
var begin_quote_index := i
|
||||
var end_quote_index := find_unescaped_quote(line, begin_quote_index + 1)
|
||||
var end_quote_index := _find_unescaped_quote(line, begin_quote_index + 1)
|
||||
if end_quote_index == -1:
|
||||
break
|
||||
|
||||
@ -293,7 +293,7 @@ func _process_quoted_text_generic(f: File, fpath: String):
|
||||
search_index = end_quote_index + 1
|
||||
|
||||
|
||||
static func find_unescaped_quote(s, from) -> int:
|
||||
static func _find_unescaped_quote(s, from) -> int:
|
||||
while true:
|
||||
var i = s.find('"', from)
|
||||
if i <= 0:
|
||||
|
@ -14,10 +14,10 @@ var _hidden_locales := []
|
||||
|
||||
func configure(hidden_locales):
|
||||
_hidden_locales = hidden_locales
|
||||
refresh_list()
|
||||
_refresh_list()
|
||||
|
||||
|
||||
func refresh_list():
|
||||
func _refresh_list():
|
||||
_languages_list.clear()
|
||||
|
||||
var filter := _filter_edit.text.strip_edges()
|
||||
@ -38,14 +38,14 @@ func refresh_list():
|
||||
_ok_button.disabled = true
|
||||
|
||||
|
||||
func submit():
|
||||
func _submit():
|
||||
var item := _languages_list.get_selected()
|
||||
emit_signal("language_selected", item.get_text(0))
|
||||
hide()
|
||||
|
||||
|
||||
func _on_OkButton_pressed():
|
||||
submit()
|
||||
_submit()
|
||||
|
||||
|
||||
func _on_CancelButton_pressed():
|
||||
@ -61,8 +61,8 @@ func _on_LanguagesList_nothing_selected():
|
||||
|
||||
|
||||
func _on_LanguagesList_item_activated():
|
||||
submit()
|
||||
_submit()
|
||||
|
||||
|
||||
func _on_FilterEdit_text_changed(new_text):
|
||||
refresh_list()
|
||||
_refresh_list()
|
||||
|
@ -10,7 +10,7 @@ static func load_po_translation(folder_path: String, valid_locales: Array, logge
|
||||
var config := {}
|
||||
|
||||
# TODO Get languages from configs, not from filenames
|
||||
var languages := get_languages_in_folder(folder_path, valid_locales, logger)
|
||||
var languages := _get_languages_in_folder(folder_path, valid_locales, logger)
|
||||
|
||||
if len(languages) == 0:
|
||||
logger.error("No .po languages were found in {0}".format([folder_path]))
|
||||
@ -217,7 +217,7 @@ static func _write_msg(f: File, msgtype: String, msg: String):
|
||||
f.store_line(str(" \"", lines[i], "\""))
|
||||
|
||||
|
||||
static func get_languages_in_folder(folder_path: String, valid_locales: Array, logger) -> Array:
|
||||
static func _get_languages_in_folder(folder_path: String, valid_locales: Array, logger) -> Array:
|
||||
var result := []
|
||||
var d := Directory.new()
|
||||
var err := d.open(folder_path)
|
||||
|
@ -53,18 +53,18 @@ func _validate():
|
||||
|
||||
|
||||
func _on_LineEdit_text_entered(new_text: String):
|
||||
submit()
|
||||
_submit()
|
||||
|
||||
|
||||
func _on_OkButton_pressed():
|
||||
submit()
|
||||
_submit()
|
||||
|
||||
|
||||
func _on_CancelButton_pressed():
|
||||
hide()
|
||||
|
||||
|
||||
func submit():
|
||||
func _submit():
|
||||
var s := _line_edit.text.strip_edges()
|
||||
emit_signal("submitted", s, _prev_str_id)
|
||||
hide()
|
||||
|
@ -195,7 +195,7 @@ func _on_FileMenu_id_pressed(id: int):
|
||||
_language_selection_dialog.popup_centered_ratio()
|
||||
|
||||
MENU_FILE_REMOVE_LANGUAGE:
|
||||
var language := get_current_language()
|
||||
var language := _get_current_language()
|
||||
_remove_language_confirmation_dialog.window_title = \
|
||||
str("Remove language `", language, "`")
|
||||
_remove_language_confirmation_dialog.popup_centered_minsize()
|
||||
@ -209,7 +209,7 @@ func _on_EditMenu_id_pressed(id: int):
|
||||
|
||||
|
||||
func _on_OpenDialog_file_selected(filepath: String):
|
||||
load_file(filepath)
|
||||
_load_file(filepath)
|
||||
|
||||
|
||||
func _on_SaveFileDialog_file_selected(filepath: String):
|
||||
@ -244,7 +244,7 @@ func _save():
|
||||
_save_file(_current_path, _current_format)
|
||||
|
||||
|
||||
func load_file(filepath: String):
|
||||
func _load_file(filepath: String):
|
||||
var ext := filepath.get_extension()
|
||||
|
||||
if ext == "po":
|
||||
@ -279,7 +279,7 @@ func load_file(filepath: String):
|
||||
for language in _languages:
|
||||
_create_translation_edit(language)
|
||||
|
||||
refresh_list()
|
||||
_refresh_list()
|
||||
_modified_languages.clear()
|
||||
_update_status_label()
|
||||
|
||||
@ -371,7 +371,7 @@ func _set_language_tab_title(language: String, title: String):
|
||||
assert(false)
|
||||
|
||||
|
||||
func get_current_language() -> String:
|
||||
func _get_current_language() -> String:
|
||||
var page = _translation_tab_container.get_current_tab_control()
|
||||
for language in _translation_edits:
|
||||
if _translation_edits[language] == page:
|
||||
@ -407,7 +407,7 @@ func _save_file(path: String, format: int):
|
||||
_update_status_label()
|
||||
|
||||
|
||||
func refresh_list():
|
||||
func _refresh_list():
|
||||
var prev_selection := _string_list.get_selected_items()
|
||||
var prev_selected_strid := ""
|
||||
if len(prev_selection) > 0:
|
||||
@ -538,7 +538,7 @@ func _add_new_string(strid: String):
|
||||
_set_language_modified(language)
|
||||
|
||||
# Update UI
|
||||
refresh_list()
|
||||
_refresh_list()
|
||||
|
||||
|
||||
func _add_new_strings(strids: Array):
|
||||
@ -557,7 +557,7 @@ func _add_new_strings(strids: Array):
|
||||
_set_language_modified(language)
|
||||
|
||||
# Update UI
|
||||
refresh_list()
|
||||
_refresh_list()
|
||||
|
||||
|
||||
func _rename_string(old_strid: String, new_strid: String):
|
||||
@ -588,7 +588,7 @@ func _add_language(language: String):
|
||||
|
||||
_logger.debug(str("Added language ", language))
|
||||
|
||||
refresh_list()
|
||||
_refresh_list()
|
||||
|
||||
|
||||
func _remove_language(language: String):
|
||||
@ -606,11 +606,11 @@ func _remove_language(language: String):
|
||||
|
||||
_logger.debug(str("Removed language ", language))
|
||||
|
||||
refresh_list()
|
||||
_refresh_list()
|
||||
|
||||
|
||||
func _on_RemoveLanguageConfirmationDialog_confirmed():
|
||||
var language := get_current_language()
|
||||
var language := _get_current_language()
|
||||
_remove_language(language)
|
||||
|
||||
|
||||
@ -632,7 +632,7 @@ func _on_ExtractorDialog_import_selected(results: Dictionary):
|
||||
|
||||
func _on_Search_text_changed(search_text: String):
|
||||
_clear_search_button.visible = (search_text != "")
|
||||
refresh_list()
|
||||
_refresh_list()
|
||||
|
||||
|
||||
func _on_ClearSearch_pressed():
|
||||
|
Loading…
Reference in New Issue
Block a user