X Tutup
Skip to content

Prevent the main locale from being set to an empty string#112899

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
timothyqiu:empty-locale
Nov 18, 2025
Merged

Prevent the main locale from being set to an empty string#112899
Repiteo merged 1 commit intogodotengine:masterfrom
timothyqiu:empty-locale

Conversation

@timothyqiu
Copy link
Member

It's assumed that TranslationServer.get_locale() always returns a non-empty string. But there is currently nothing to prevent it from being set to an empty string.

Note: Technically, being non-empty is not enough for a string to be a valid locale. However, this appears to be the only requirement for locales in the current codebase.

Another reason for this change was that Akien encountered a case where interface/editor/editor_language somehow carries an empty string, which caused an error spam when importing a 3D model. This issue cannot be reproduced consistently, but we should at least turn the error spam into only one error on startup.

Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@Ivorforce Ivorforce requested a review from a team November 18, 2025 09:13
@akien-mga akien-mga added this to the 4.6 milestone Nov 18, 2025
@Repiteo Repiteo merged commit 3a3af8d into godotengine:master Nov 18, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 18, 2025

Thanks!

@timothyqiu timothyqiu deleted the empty-locale branch November 19, 2025 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup