mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 09:09:47 +00:00
Fixed bug where if Pixelorama started with Greek and went to English, the menu items would remain in Greek
This commit is contained in:
parent
92e841f20d
commit
e157b33e1d
|
@ -31,17 +31,6 @@ func _ready() -> void:
|
|||
# Load settings from the config file
|
||||
config_cache.load("user://cache.ini")
|
||||
|
||||
# Load language
|
||||
if config_cache.has_section_key("preferences", "locale"):
|
||||
var saved_locale : String = config_cache.get_value("preferences", "locale")
|
||||
TranslationServer.set_locale(saved_locale)
|
||||
|
||||
# Set the language option menu's default selected option to the loaded locale
|
||||
var locale_index := loaded_locales.find(saved_locale)
|
||||
$PreferencesDialog/VBoxContainer/OptionsContainer/LanguageOption.selected = locale_index + 1
|
||||
else: # If the user doesn't have a language preference, set it to their OS' locale
|
||||
TranslationServer.set_locale(OS.get_locale())
|
||||
|
||||
# Restore the window position/size if values are present in the configuration cache
|
||||
if config_cache.has_section_key("window", "screen"):
|
||||
OS.current_screen = config_cache.get_value("window", "screen")
|
||||
|
@ -83,6 +72,18 @@ func _ready() -> void:
|
|||
var help_menu_items := {
|
||||
tr("About Pixelorama") : 0
|
||||
}
|
||||
|
||||
# Load language
|
||||
if config_cache.has_section_key("preferences", "locale"):
|
||||
var saved_locale : String = config_cache.get_value("preferences", "locale")
|
||||
TranslationServer.set_locale(saved_locale)
|
||||
|
||||
# Set the language option menu's default selected option to the loaded locale
|
||||
var locale_index := loaded_locales.find(saved_locale)
|
||||
$PreferencesDialog/VBoxContainer/OptionsContainer/LanguageOption.selected = locale_index + 1
|
||||
else: # If the user doesn't have a language preference, set it to their OS' locale
|
||||
TranslationServer.set_locale(OS.get_locale())
|
||||
|
||||
var file_menu : PopupMenu = Global.file_menu.get_popup()
|
||||
var edit_menu : PopupMenu = Global.edit_menu.get_popup()
|
||||
view_menu = Global.view_menu.get_popup()
|
||||
|
|
Loading…
Reference in a new issue