You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
The previous code only parsed the first two characters (potentially reading out of bounds if input was invalid), but some locales use a 3-letter language code (e.g. 'nah_MX'). So I refactored the logic a bit to properly parse the locale and extract the part left of the regional code, if provided (supports both 'en_US' and 'en-US' style). I made TranslationServer::get_language_code() public as I'll use it in a follow up commit.
4.5 KiB
4.5 KiB