From 0ca9e7ef3d669154b94adb662cd6d9bfc59f67c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=9A=93?= Date: Wed, 4 Jun 2025 09:29:38 -0400 Subject: [PATCH] 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". --- binding-sandbox/binding-sandbox.cpp | 70 ++++++++++++++--------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/binding-sandbox/binding-sandbox.cpp b/binding-sandbox/binding-sandbox.cpp index 5f65732f..5de1ea5d 100644 --- a/binding-sandbox/binding-sandbox.cpp +++ b/binding-sandbox/binding-sandbox.cpp @@ -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()()(str);