Skip to content

Commit fab780e

Browse files
committed
fix: apply translations to report problem popup
fix #836
1 parent 828df41 commit fab780e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

ui/components/popups/ReportFormPopup.gd

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ onready var _panel := $PanelContainer as PanelContainer
55

66
onready var _confirm_button := $PanelContainer/Column/Margin/Column/ConfirmButton as Button
77
onready var _summary_label := $PanelContainer/Column/Margin/Column/Summary as RichTextLabel
8+
onready var _title_label: Label = $PanelContainer/Column/Margin/Column/Title
9+
10+
onready var _title := _title_label.text
11+
onready var _summary := _summary_label.bbcode_text
812

913

1014
func _ready():
1115
hide()
1216
_confirm_button.connect("pressed", self, "hide")
1317
_summary_label.connect("meta_clicked", self, "_on_meta_clicked")
14-
18+
_update_translations()
1519

1620
func show() -> void:
1721
_color_rect.show()
@@ -30,3 +34,14 @@ func _on_meta_clicked(data) -> void:
3034
OS.shell_open(data)
3135
elif data == "download":
3236
Log.download()
37+
38+
39+
func _notification(what: int) -> void:
40+
if what == NOTIFICATION_TRANSLATION_CHANGED:
41+
_update_translations()
42+
43+
44+
func _update_translations() -> void:
45+
if _title_label:
46+
_title_label.text = tr(_title)
47+
_summary_label.bbcode_text = tr(_summary)

0 commit comments

Comments
 (0)