Last active
August 25, 2021 03:03
Revisions
-
ericdsw revised this gist
Aug 25, 2021 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ class_name LManager extends Node signal language_changed(new_language) const BASE_DIALOGUE_PATH := "res://resources/dialogues/" var language := "en" func get_dialogue_json(dialogue_name: String) -> String: var _localized_dialogue := BASE_DIALOGUE_PATH + language + "/" + dialogue_name var _file := File.new() if _file.file_exists(_localized_dialogue): return _localized_dialogue return BASE_DIALOGUE_PATH + dialogue_name func update_language(new_language: String) -> void: language = new_language TranslationServer.set_locale(language) emit_signal("language_changed", language) -
ericdsw revised this gist
Aug 25, 2021 . 2 changed files with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ { "surprised": [ "no", "way", ] } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ { "surprised": [ "no", "puede", "ser" ] } -
ericdsw revised this gist
Aug 25, 2021 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ { "message_1": [ "The first part of the conversation", "The second part of the conversation", "The third part of the conversation ] } -
ericdsw revised this gist
Aug 25, 2021 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ extends Control onready var label_two := get_node("LabelTwo") as Label func _ready() -> void: LocalizationManager.connect("language_changed", self, "_on_language_changed") label_two.text = tr("UI_STRING_TWO") func _on_SpanishButton_pressed() -> void: LocalizationManager.update_language("es") func _on_EnglishButton_pressed() -> void: LocalizationManager.update_language("en") func _on_language_changed(new_language: String) -> void: label_two.text = tr("UI_STRING_TWO") -
ericdsw renamed this gist
Aug 25, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ericdsw revised this gist
Aug 25, 2021 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ class_name LManager extends Node signal language_changed(new_language) var language := "en" func update_language(new_language: String) -> void: language = new_language TranslationServer.set_locale(language) emit_signal("language_changed", language) -
ericdsw revised this gist
Aug 25, 2021 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ extends Control onready var label_two := get_node("LabelTwo") as Label func _ready() -> void: label_two.text = tr("UI_STRING_TWO") func _on_SpanishButton_pressed() -> void: LocalizationManager.update_language("es") func _on_EnglishButton_pressed() -> void: LocalizationManager.update_language("en") -
ericdsw revised this gist
Aug 25, 2021 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ extends Control func _on_SpanishButton_pressed() -> void: LocalizationManager.update_language("es") func _on_EnglishButton_pressed() -> void: LocalizationManager.update_language("en") -
ericdsw revised this gist
Aug 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ class_name LManager extends Node var language := "en" -
ericdsw revised this gist
Aug 24, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,4 @@ var language := "en" func update_language(new_language: String) -> void: language = new_language TranslationServer.set_locale(language) -
ericdsw revised this gist
Aug 24, 2021 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,6 @@ extends Node var language := "en" func update_language(new_language: String) -> void: language = new_language TranslationServer.set_locale(language) -
ericdsw renamed this gist
Aug 24, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ericdsw created this gist
Aug 24, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ class_name LocalizationManager extends Node var language := "en" func update_language(new_language: String) -> void: language = new_language TranslationServer.set_locale(language)