Skip to content

Commit

Permalink
Re-added deepl button
Browse files Browse the repository at this point in the history
  • Loading branch information
dannygaray60 committed Nov 18, 2022
1 parent e653c15 commit c605460
Show file tree
Hide file tree
Showing 6 changed files with 663 additions and 645 deletions.
1,260 changes: 630 additions & 630 deletions src/CSV Files to Test/LocalizationsListLong.csv

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/addons/localization_editor_plugin_g3/Dock.gd
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func _ready() -> void:
get_node("%TxtSettingFCell").text = Conf.get_value("csv","f_cell","keys")
get_node("%TxtSettingDelimiter").text = Conf.get_value("csv","delimiter",",")
get_node("%CheckBoxSettingReopenFile").pressed = Conf.get_value("main","reopen_last_file",false)
get_node("%CheckBoxSettingHideDeepLButton").pressed = Conf.get_value("main","hide_deepl_button",false)

load_recent_files_list()

Expand Down Expand Up @@ -193,6 +194,10 @@ func add_translation_panel(
TransInstance.trans_txt = trans_txt
TransInstance.need_revision = TransConf.get_value(strkey, "need_rev", false)
TransInstance.annotations = TransConf.get_value(strkey, "annotations", "")

TransInstance.hide_deepl_button(
Conf.get_value("main", "hide_deepl_button", false)
)

get_node("%VBxTranslations").call_deferred("add_child", TransInstance)

Expand Down Expand Up @@ -681,6 +686,8 @@ func _on_ApiTranslate_text_translated(
## se cambio el check de reabrir ultimo archivo abierto
func _on_CheckBoxSettingReopenFile_toggled(button_pressed: bool) -> void:
Conf.set_value("main", "reopen_last_file", button_pressed)
func _on_CheckBoxSettingHideDeepLButton_toggled(button_pressed: bool) -> void:
Conf.set_value("main", "hide_deepl_button", button_pressed)


func _on_LinkHowToUse_pressed() -> void:
Expand Down
29 changes: 19 additions & 10 deletions src/addons/localization_editor_plugin_g3/Dock.tscn

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func _ready() -> void:
focus_line_edit()
get_node("%LineEditTranslation").caret_position = get_node("%LineEditTranslation").text.length()

func hide_deepl_button(val:bool) -> void:
get_node("%BtnTranslateDeepL").visible = val

func focus_line_edit() -> void:
get_node("%LineEditTranslation").grab_focus()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@ custom_constants/separation = 11
unique_name_in_owner = true
modulate = Color( 1, 1, 1, 0.47451 )
margin_top = 7.0
margin_right = 197.0
margin_right = 158.0
margin_bottom = 21.0
size_flags_horizontal = 3
text = "ItemTranslation"
clip_text = true

[node name="BtnTranslate" type="Button" parent="VBxString1/HBoxContainer"]
unique_name_in_owner = true
margin_left = 208.0
margin_right = 306.0
margin_left = 169.0
margin_right = 267.0
margin_bottom = 28.0
focus_mode = 0
enabled_focus_mode = 0
Expand All @@ -114,7 +114,6 @@ icon = ExtResource( 5 )

[node name="BtnTranslateDeepL" type="Button" parent="VBxString1/HBoxContainer"]
unique_name_in_owner = true
visible = false
margin_left = 278.0
margin_right = 306.0
margin_bottom = 28.0
Expand Down
2 changes: 1 addition & 1 deletion src/addons/localization_editor_plugin_g3/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="Localization Editor"
description="Tool for Localization Management in .csv files."
author="Danny Garay (@dannygaray60)"
version="1.2"
version="1.3"
script="plugin.gd"

0 comments on commit c605460

Please sign in to comment.