diff --git a/Main.tscn b/Main.tscn index 55e3e91..c504bf2 100644 --- a/Main.tscn +++ b/Main.tscn @@ -550,10 +550,10 @@ grow_vertical = 2 color = Color(0.14902, 0.14902, 0.14902, 1) [node name="FileDialog" type="FileDialog" parent="CreatePlaylistsMenu"] -title = "DIR_OPEN" +title = "Open a Directory" initial_position = 2 size = Vector2i(352, 180) -ok_button_text = "DIR_OPEN" +ok_button_text = "Select Current Folder" cancel_button_text = "CANCEL" file_mode = 2 access = 2 @@ -648,10 +648,10 @@ shortcut = SubResource("Shortcut_axi6u") text = "RANDOMIZE" [node name="FileDialog" type="FileDialog" parent="."] -title = "DIR_OPEN" +title = "Open a Directory" position = Vector2i(28, 115) size = Vector2i(833, 507) -ok_button_text = "DIR_OPEN" +ok_button_text = "Select Current Folder" cancel_button_text = "CANCEL" file_mode = 2 access = 2 @@ -919,7 +919,7 @@ offset_left = -64.0 offset_top = -23.0 grow_horizontal = 0 grow_vertical = 0 -text = "v1.6" +text = "v1.6h1" horizontal_alignment = 2 [node name="SettingsButton" type="Button" parent="."] diff --git a/Settings.tscn b/Settings.tscn index 860d455..7686512 100644 --- a/Settings.tscn +++ b/Settings.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=10 format=3 uid="uid://dqg674t6kun4e"] +[gd_scene load_steps=11 format=3 uid="uid://dqg674t6kun4e"] [ext_resource type="Script" uid="uid://vnpslgl788du" path="res://settings.gd" id="1_uaa7d"] [ext_resource type="Script" uid="uid://kt7n1epi3ng8" path="res://eq_settings.gd" id="2_1n4m6"] [ext_resource type="Texture2D" uid="uid://1rstn6r2wisy" path="res://X.png" id="2_iuivb"] [ext_resource type="Texture2D" uid="uid://pgij783wgbhn" path="res://File.png" id="2_jmen4"] +[ext_resource type="Script" uid="uid://cej7efsj2cyen" path="res://language_button.gd" id="2_sfvul"] [sub_resource type="LabelSettings" id="LabelSettings_ouq8m"] font_size = 30 @@ -104,6 +105,25 @@ vertical_alignment = 1 autowrap_mode = 2 uppercase = true +[node name="Seperator8" type="Control" parent="ScrollContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 16.07) +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="ScrollContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "LANGUAGE" + +[node name="LanguageButton" type="MenuButton" parent="ScrollContainer/VBoxContainer/HBoxContainer" node_paths=PackedStringArray("settings")] +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "SELECT" +flat = false +script = ExtResource("2_sfvul") +settings = NodePath("../../../..") + [node name="Seperator3" type="Control" parent="ScrollContainer/VBoxContainer"] custom_minimum_size = Vector2(0, 16.07) layout_mode = 2 diff --git a/language_button.gd b/language_button.gd new file mode 100644 index 0000000..b98f231 --- /dev/null +++ b/language_button.gd @@ -0,0 +1,14 @@ +extends MenuButton + +@export var settings:Settings + +func _ready() -> void: + for trans_language in TranslationServer.get_loaded_locales(): + get_popup().add_item(trans_language) + get_popup().id_pressed.connect(got_pressed) + + +func got_pressed(id:int) -> void: + settings.Parent.overridden_locale = get_popup().get_item_text(id) + TranslationServer.set_locale(get_popup().get_item_text(id)) + settings.Parent.SaveEverything() diff --git a/language_button.gd.uid b/language_button.gd.uid new file mode 100644 index 0000000..5a92951 --- /dev/null +++ b/language_button.gd.uid @@ -0,0 +1 @@ +uid://cej7efsj2cyen diff --git a/main.gd b/main.gd index 9e810fd..1de2a64 100644 --- a/main.gd +++ b/main.gd @@ -32,6 +32,7 @@ extends Control @onready var delete_confirm: ConfirmationDialog = $deleteConfirm @onready var search_bar: LineEdit = $SearchBar @onready var playing_now: Window = $PlayingNow +@export var overridden_locale:String var DiscordUsername:String @@ -167,6 +168,9 @@ func _ready() -> void: play_all.button_pressed = true if data.has("UsingPlayingNow"): UsingPlayingNow = data["UsingPlayingNow"] + if data.has("OverriddenLocale"): + TranslationServer.set_locale(data["OverriddenLocale"]) + overridden_locale = data["OverriddenLocale"] else: if data != null: print(data["Volume"]) @@ -592,7 +596,8 @@ func SaveEverything(): "CurrentCustomBackroundImageDirectory" : CurrentCustomBackroundImageDirectory, "PlayAllLists" : PlayAllLists, "DiscordUsername" : DiscordRPC.get_current_user().get("username"), - "UsingPlayingNow" : UsingPlayingNow + "UsingPlayingNow" : UsingPlayingNow, + "OverriddenLocale" : overridden_locale } print("saving") saveUserdata(Data) diff --git a/translation/translations.csv b/translation/translations.csv index a3b7d6e..53fe8ed 100644 --- a/translation/translations.csv +++ b/translation/translations.csv @@ -82,3 +82,5 @@ CONFIRM,Please Confirm…,Bitte bestimme… DL_SONG,Download Song,Nur Lied Herunterladen DL_LIST,Download Playlist,Playliste Herunterladen DL_DIALOG,Do you want to download the song or the Entire playlist?,Willst du die playlist herunterladen? +LANGUAGE,Language:,Sprache: +SELECT,Select ,Auswählen diff --git a/translation/translations.de.translation b/translation/translations.de.translation index 5092754..8a3a009 100644 Binary files a/translation/translations.de.translation and b/translation/translations.de.translation differ diff --git a/translation/translations.en.translation b/translation/translations.en.translation index 28d3b8f..773e449 100644 Binary files a/translation/translations.en.translation and b/translation/translations.en.translation differ