Don't include .UTF-8 at the ends of locale names in libretro builds

This is for consistency with standalone builds, which report locale
names without the encoding and with an underscore between the language
and region, e.g. "en_US".
This commit is contained in:
刘皓 2025-06-04 09:29:38 -04:00
parent d626b570ec
commit 0ca9e7ef3d
No known key found for this signature in database
GPG key ID: 7901753DB465B711

View file

@ -323,41 +323,41 @@ static VALUE user_language(VALUE self) {
language = RETRO_LANGUAGE_ENGLISH;
}
switch (language) {
default: case RETRO_LANGUAGE_ENGLISH: str = "en_US.UTF-8"; break;
case RETRO_LANGUAGE_JAPANESE: str = "ja_JP.UTF-8"; break;
case RETRO_LANGUAGE_FRENCH: str = "fr_FR.UTF-8"; break;
case RETRO_LANGUAGE_SPANISH: str = "es_ES.UTF-8"; break;
case RETRO_LANGUAGE_GERMAN: str = "de_DE.UTF-8"; break;
case RETRO_LANGUAGE_ITALIAN: str = "it_IT.UTF-8"; break;
case RETRO_LANGUAGE_DUTCH: str = "nl_NL.UTF-8"; break;
case RETRO_LANGUAGE_PORTUGUESE_BRAZIL: str = "pt_BR.UTF-8"; break;
case RETRO_LANGUAGE_PORTUGUESE_PORTUGAL: str = "pt_PT.UTF-8"; break;
case RETRO_LANGUAGE_RUSSIAN: str = "ru_RU.UTF-8"; break;
case RETRO_LANGUAGE_KOREAN: str = "ko_KR.UTF-8"; break;
case RETRO_LANGUAGE_CHINESE_TRADITIONAL: str = "zh_TW.UTF-8"; break;
case RETRO_LANGUAGE_CHINESE_SIMPLIFIED: str = "zh_CN.UTF-8"; break;
case RETRO_LANGUAGE_ESPERANTO: str = "eo.UTF-8"; break;
case RETRO_LANGUAGE_POLISH: str = "pl_PL.UTF-8"; break;
case RETRO_LANGUAGE_VIETNAMESE: str = "vi_VN.UTF-8"; break;
case RETRO_LANGUAGE_ARABIC: str = "ar_SA.UTF-8"; break;
case RETRO_LANGUAGE_GREEK: str = "el_GR.UTF-8"; break;
case RETRO_LANGUAGE_TURKISH: str = "tr_TR.UTF-8"; break;
case RETRO_LANGUAGE_SLOVAK: str = "sk_SK.UTF-8"; break;
case RETRO_LANGUAGE_PERSIAN: str = "fa_IR.UTF-8"; break;
case RETRO_LANGUAGE_HEBREW: str = "he_IL.UTF-8"; break;
case RETRO_LANGUAGE_ASTURIAN: str = "ast_ES.UTF-8"; break;
case RETRO_LANGUAGE_FINNISH: str = "fi_FI.UTF-8"; break;
case RETRO_LANGUAGE_INDONESIAN: str = "id_ID.UTF-8"; break;
case RETRO_LANGUAGE_SWEDISH: str = "sv_SE.UTF-8"; break;
case RETRO_LANGUAGE_UKRAINIAN: str = "uk_UA.UTF-8"; break;
case RETRO_LANGUAGE_CZECH: str = "cs_CZ.UTF-8"; break;
case RETRO_LANGUAGE_CATALAN_VALENCIA: str = "ca_ES.UTF-8"; break;
case RETRO_LANGUAGE_CATALAN: str = "ca_AD.UTF-8"; break;
case RETRO_LANGUAGE_BRITISH_ENGLISH: str = "en_GB.UTF-8"; break;
case RETRO_LANGUAGE_HUNGARIAN: str = "hu_HU.UTF-8"; break;
case RETRO_LANGUAGE_BELARUSIAN: str = "be_BY.UTF-8"; break;
case RETRO_LANGUAGE_GALICIAN: str = "gl_ES.UTF-8"; break;
case RETRO_LANGUAGE_NORWEGIAN: str = "no_NO.UTF-8"; break;
default: case RETRO_LANGUAGE_ENGLISH: str = "en_US"; break;
case RETRO_LANGUAGE_JAPANESE: str = "ja_JP"; break;
case RETRO_LANGUAGE_FRENCH: str = "fr_FR"; break;
case RETRO_LANGUAGE_SPANISH: str = "es_ES"; break;
case RETRO_LANGUAGE_GERMAN: str = "de_DE"; break;
case RETRO_LANGUAGE_ITALIAN: str = "it_IT"; break;
case RETRO_LANGUAGE_DUTCH: str = "nl_NL"; break;
case RETRO_LANGUAGE_PORTUGUESE_BRAZIL: str = "pt_BR"; break;
case RETRO_LANGUAGE_PORTUGUESE_PORTUGAL: str = "pt_PT"; break;
case RETRO_LANGUAGE_RUSSIAN: str = "ru_RU"; break;
case RETRO_LANGUAGE_KOREAN: str = "ko_KR"; break;
case RETRO_LANGUAGE_CHINESE_TRADITIONAL: str = "zh_TW"; break;
case RETRO_LANGUAGE_CHINESE_SIMPLIFIED: str = "zh_CN"; break;
case RETRO_LANGUAGE_ESPERANTO: str = "eo"; break;
case RETRO_LANGUAGE_POLISH: str = "pl_PL"; break;
case RETRO_LANGUAGE_VIETNAMESE: str = "vi_VN"; break;
case RETRO_LANGUAGE_ARABIC: str = "ar_SA"; break;
case RETRO_LANGUAGE_GREEK: str = "el_GR"; break;
case RETRO_LANGUAGE_TURKISH: str = "tr_TR"; break;
case RETRO_LANGUAGE_SLOVAK: str = "sk_SK"; break;
case RETRO_LANGUAGE_PERSIAN: str = "fa_IR"; break;
case RETRO_LANGUAGE_HEBREW: str = "he_IL"; break;
case RETRO_LANGUAGE_ASTURIAN: str = "ast_ES"; break;
case RETRO_LANGUAGE_FINNISH: str = "fi_FI"; break;
case RETRO_LANGUAGE_INDONESIAN: str = "id_ID"; break;
case RETRO_LANGUAGE_SWEDISH: str = "sv_SE"; break;
case RETRO_LANGUAGE_UKRAINIAN: str = "uk_UA"; break;
case RETRO_LANGUAGE_CZECH: str = "cs_CZ"; break;
case RETRO_LANGUAGE_CATALAN_VALENCIA: str = "ca_ES"; break;
case RETRO_LANGUAGE_CATALAN: str = "ca_AD"; break;
case RETRO_LANGUAGE_BRITISH_ENGLISH: str = "en_GB"; break;
case RETRO_LANGUAGE_HUNGARIAN: str = "hu_HU"; break;
case RETRO_LANGUAGE_BELARUSIAN: str = "be_BY"; break;
case RETRO_LANGUAGE_GALICIAN: str = "gl_ES"; break;
case RETRO_LANGUAGE_NORWEGIAN: str = "no_NO"; break;
}
return sb()->bind<struct rb_str_new_cstr>()()(str);