Skip to content

Commit

Permalink
Add Belarusian language option (libretro#15780)
Browse files Browse the repository at this point in the history
  • Loading branch information
viachaslavic authored and Sunderland93 committed Dec 26, 2024
1 parent 499f9ef commit 7888ee8
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -9880,6 +9880,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_LANG_BASQUE,
"Basque - Euskara"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_LANG_BELARUSIAN,
"Belarusian - Беларуская мова"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_LANG_BENGALI,
"Bengali - বাংলা (Restart Required)"
Expand Down
1 change: 1 addition & 0 deletions libretro-common/include/libretro.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ enum retro_language
RETRO_LANGUAGE_CATALAN = 29,
RETRO_LANGUAGE_BRITISH_ENGLISH = 30,
RETRO_LANGUAGE_HUNGARIAN = 31,
RETRO_LANGUAGE_BELARUSIAN = 32,
RETRO_LANGUAGE_LAST,

/* Ensure sizeof(enum) == sizeof(int) */
Expand Down
3 changes: 3 additions & 0 deletions menu/drivers/rgui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,7 @@ static bool rgui_fonts_init(rgui_t *rgui)
}

case RETRO_LANGUAGE_RUSSIAN:
case RETRO_LANGUAGE_BELARUSIAN:
{
rgui->fonts.eng_10x10 = bitmapfont_10x10_load(RETRO_LANGUAGE_ENGLISH);
rgui->fonts.rus_10x10 = bitmapfont_10x10_load(RETRO_LANGUAGE_RUSSIAN);
Expand Down Expand Up @@ -4343,6 +4344,7 @@ static void rgui_set_blit_functions(
rgui_blit_line = rgui_blit_line_cjk_shadow;
break;
case RETRO_LANGUAGE_RUSSIAN:
case RETRO_LANGUAGE_BELARUSIAN:
rgui_blit_line = rgui_blit_line_rus_shadow;
break;
case RETRO_LANGUAGE_ESPERANTO:
Expand Down Expand Up @@ -4381,6 +4383,7 @@ static void rgui_set_blit_functions(
rgui_blit_line = rgui_blit_line_cjk;
break;
case RETRO_LANGUAGE_RUSSIAN:
case RETRO_LANGUAGE_BELARUSIAN:
rgui_blit_line = rgui_blit_line_rus;
break;
case RETRO_LANGUAGE_ESPERANTO:
Expand Down
4 changes: 4 additions & 0 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -3219,6 +3219,9 @@ static void setting_get_string_representation_uint_ai_service_lang(
case TRANSLATION_LANG_UK:
enum_idx = MENU_ENUM_LABEL_VALUE_LANG_UKRAINIAN;
break;
case TRANSLATION_LANG_BE:
enum_idx = MENU_ENUM_LABEL_VALUE_LANG_BELARUSIAN;
break;
case TRANSLATION_LANG_UR:
enum_idx = MENU_ENUM_LABEL_VALUE_LANG_URDU;
break;
Expand Down Expand Up @@ -6924,6 +6927,7 @@ static void setting_get_string_representation_uint_user_language(
translated[RETRO_LANGUAGE_BRITISH_ENGLISH] = LANGUAGE_PROGRESS_ENGLISH_UNITED_KINGDOM_TRANSLATED;

LANG_DATA(HUNGARIAN)
LANG_DATA(BELARUSIAN)

if (*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE) == RETRO_LANGUAGE_ENGLISH)
strlcpy(s, modes[*msg_hash_get_uint(MSG_HASH_USER_LANGUAGE)], len);
Expand Down
17 changes: 17 additions & 0 deletions msg_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ const char *get_user_language_iso639_1(bool limit)
return "en_gb";
case RETRO_LANGUAGE_HUNGARIAN:
return "hu";
case RETRO_LANGUAGE_BELARUSIAN:
return "be";
}
return "en";
}
Expand Down Expand Up @@ -217,6 +219,18 @@ static const char *msg_hash_to_str_hu(enum msg_hash_enums msg)
return "null";
}

static const char *msg_hash_to_str_be(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_be.h"
default:
break;
}

return "null";
}

static const char *msg_hash_to_str_en(enum msg_hash_enums msg)
{
switch (msg)
Expand Down Expand Up @@ -607,6 +621,9 @@ const char *msg_hash_to_str(enum msg_hash_enums msg)
case RETRO_LANGUAGE_HUNGARIAN:
ret = msg_hash_to_str_hu(msg);
break;
case RETRO_LANGUAGE_BELARUSIAN:
ret = msg_hash_to_str_be(msg);
break;
default:
break;
}
Expand Down
1 change: 1 addition & 0 deletions msg_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -3471,6 +3471,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_LANG_TELUGU,
MENU_ENUM_LABEL_VALUE_LANG_THAI,
MENU_ENUM_LABEL_VALUE_LANG_UKRAINIAN,
MENU_ENUM_LABEL_VALUE_LANG_BELARUSIAN,
MENU_ENUM_LABEL_VALUE_LANG_URDU,
MENU_ENUM_LABEL_VALUE_LANG_CATALAN_VALENCIA,
MENU_ENUM_LABEL_VALUE_LANG_WELSH,
Expand Down
1 change: 1 addition & 0 deletions retroarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -7342,6 +7342,7 @@ enum retro_language retroarch_get_language_from_iso(const char *iso639)
{"en_GB", RETRO_LANGUAGE_BRITISH_ENGLISH},
{"en", RETRO_LANGUAGE_ENGLISH},
{"hu", RETRO_LANGUAGE_HUNGARIAN},
{"be", RETRO_LANGUAGE_BELARUSIAN},
};

if (string_is_empty(iso639))
Expand Down
2 changes: 2 additions & 0 deletions tasks/task_translation.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ static const char* ai_service_get_str(enum translation_lang id)
return "tr";
case TRANSLATION_LANG_UK:
return "uk";
case TRANSLATION_LANG_BE:
return "be";
case TRANSLATION_LANG_UR:
return "ur";
case TRANSLATION_LANG_VI:
Expand Down
1 change: 1 addition & 0 deletions translation_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ enum translation_lang
TRANSLATION_LANG_TH, /* Thai */
TRANSLATION_LANG_TR, /* Turkish */
TRANSLATION_LANG_UK, /* Ukrainian */
TRANSLATION_LANG_BE, /* Belarusian */
TRANSLATION_LANG_UR, /* Urdu */
TRANSLATION_LANG_VI, /* Vietnamese */
TRANSLATION_LANG_CY, /* Welsh */
Expand Down

0 comments on commit 7888ee8

Please sign in to comment.