Skip to content

Add get_locale() for default languages #5

@dragonforge-dev

Description

@dragonforge-dev

Dragonforge:

Out of curiosity, could you add a Polish translation, delete the configuration.settings file in app_userdata for the project and see if it defaults to polish for you? There’s an OS locale detection Godot has that I called and I’m curious if it works.

WCHC:

It does work if I add the pl translation, but doesn’t work if I add pl_PL translation.
You’re using OS.get_locale_language() here:

	if current_selection == -1:
		var preferred_language: String = OS.get_locale_language()

which gets just the pl, so the pl_PL won’t be matched.

print(OS.get_locale_language()) ## prints "pl"
print(OS.get_locale()) ## prints "pl_PL"

Maybe you could first check if there is a full locale match and only after that fallback to locale_language.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions