diff --git a/addons/file-editor/file.samples/translation.csv b/addons/file-editor/file.samples/translation.csv new file mode 100644 index 0000000..e7bec4a --- /dev/null +++ b/addons/file-editor/file.samples/translation.csv @@ -0,0 +1,8 @@ +keys;en;it;da;de;ja;es +HELLO;"""Hello!""";"""Ciao!""";"""Hej!""";"""Hallo!""";"""こんにちは!""";"""¡Hola!""" +BYE;"""Bye bye!""";"""Ciao ciao!""";"""Hej hej!""";"""Tschüss!""";"""バイバイ!""";"""¡Adiós!""" +GOODMORNING;"""Gooedmorning!""";"""Buongiorno!""";"""Gooedmorning!""";"""Guten Morgen!""";"""グーエドモーニング!""";"""¡Buen día!""" +CONFIRM;"""Confirm this action""";"""Conferma questa azione""";"""Bekræft denne handling""";"""Bestätigen Sie diese Aktion""";"""このアクションを確認します""";"""Confirma esta acción""" +CANCEL;"""Cancel this action""";"""Annulla questa azione""";"""Annuller denne handling""";"""Brechen Sie diese Aktion ab""";"""このアクションをキャンセルします""";"""Cancelar esta acción""" +YES;"""Yes, please""";"""Sì grazie""";"""Ja tak""";"""Ja bitte""";"""はい、お願いします""";"""Sí por favor""" +NO;"""No, thanks""";"""No grazie""";"""Nej tak""";"""Nein Danke""";"""結構です""";"""No, gracias""" diff --git a/addons/file-editor/file.samples/translation.csv.import b/addons/file-editor/file.samples/translation.csv.import new file mode 100644 index 0000000..8ff416d --- /dev/null +++ b/addons/file-editor/file.samples/translation.csv.import @@ -0,0 +1,10 @@ +[remap] + +importer="csv" +type="TextFile" + +[deps] + +source_file="res://addons/file-editor/file.samples/translation.csv" +[params] + diff --git a/addons/file-editor/lastopenedfiles.lastcfg b/addons/file-editor/lastopenedfiles.lastcfg index ff4226f..3ea5c54 100644 --- a/addons/file-editor/lastopenedfiles.lastcfg +++ b/addons/file-editor/lastopenedfiles.lastcfg @@ -6,4 +6,4 @@ sample.html="res://addons/file-editor/file.samples/sample.html" sample.ini="res://addons/file-editor/file.samples/sample.ini" sample.md="res://addons/file-editor/file.samples/sample.md" sample.txt="res://addons/file-editor/file.samples/sample.txt" -translation_example2.csv="res://translation_example2.csv" +translation.csv="res://addons/file-editor/file.samples/translation.csv" diff --git a/addons/file-editor/scenes/CSVEditor.tscn b/addons/file-editor/scenes/CSVEditor.tscn index 2c5151a..876b7bc 100644 --- a/addons/file-editor/scenes/CSVEditor.tscn +++ b/addons/file-editor/scenes/CSVEditor.tscn @@ -432,7 +432,6 @@ custom_icons/checked = SubResource( 28 ) custom_icons/unchecked = SubResource( 30 ) [node name="EditDialog" type="AcceptDialog" parent="."] -visible = true anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 diff --git a/addons/file-editor/scripts/CSVEditor.gd b/addons/file-editor/scripts/CSVEditor.gd index 6869d0c..2eb638e 100644 --- a/addons/file-editor/scripts/CSVEditor.gd +++ b/addons/file-editor/scripts/CSVEditor.gd @@ -2,6 +2,8 @@ tool extends Control class_name CSVEditor +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() + onready var Columns : HBoxContainer = $Container/Scroll/Columns onready var _column_head : VBoxContainer = Columns.get_node("_COLUMN_HEAD") onready var _row_label : Label = _column_head.get_node("1") diff --git a/addons/file-editor/scripts/GoogleTranslatorAPI.gd b/addons/file-editor/scripts/GoogleTranslatorAPI.gd index 58cf5ba..72757d1 100644 --- a/addons/file-editor/scripts/GoogleTranslatorAPI.gd +++ b/addons/file-editor/scripts/GoogleTranslatorAPI.gd @@ -1,3 +1,4 @@ +tool extends HTTPRequest class_name GoogleTranslateAPI diff --git a/addons/file-editor/scripts/file-editor.gd b/addons/file-editor/scripts/file-editor.gd index e347a83..44805fe 100644 --- a/addons/file-editor/scripts/file-editor.gd +++ b/addons/file-editor/scripts/file-editor.gd @@ -1,22 +1,17 @@ tool extends EditorPlugin -#var doc = preload("../scenes/FileEditor.tscn") - var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() var FileEditor func _enter_tree(): - add_autoload_singleton("IconLoader","res://addons/file-editor/scripts/IconLoader.gd") add_autoload_singleton("LastOpenedFiles","res://addons/file-editor/scripts/LastOpenedFiles.gd") FileEditor = preload("../scenes/FileEditor.tscn").instance() get_editor_interface().get_editor_viewport().add_child(FileEditor) FileEditor.hide() func _exit_tree(): -# FileEditor.clean_editor() - remove_autoload_singleton("IconLoader") remove_autoload_singleton("LastOpenedFiles") get_editor_interface().get_editor_viewport().remove_child(FileEditor)