From def99c7baf1880e3efc0b60b9eb035be8a7edb14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 16 Sep 2021 09:27:56 +0200 Subject: Implement `OS::get_locale_language()` helper method This method extracts the 2 or 3-letter language code from `OS::get_locale()`, making it easier for users to identify the "main" language code for users that might have different OS locales due to different OS or region, but should be matched to the same translation (e.g. "generic" Spanish). Fixes #40703. --- core/os/os.h | 1 + 1 file changed, 1 insertion(+) (limited to 'core/os/os.h') diff --git a/core/os/os.h b/core/os/os.h index f585483300..c027428477 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -243,6 +243,7 @@ public: RenderThreadMode get_render_thread_mode() const { return _render_thread_mode; } virtual String get_locale() const; + String get_locale_language() const; String get_safe_dir_name(const String &p_dir_name, bool p_allow_dir_separator = false) const; virtual String get_godot_dir_name() const; -- cgit v1.2.3