Skip to content

Commit

Permalink
Add Belarusian language option
Browse files Browse the repository at this point in the history
  • Loading branch information
viachaslavic committed Oct 10, 2023
1 parent f3c6550 commit 75b4bf3
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 14 deletions.
4 changes: 4 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -9856,6 +9856,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
5 changes: 3 additions & 2 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 Expand Up @@ -3195,13 +3196,13 @@ enum retro_savestate_context

/* Savestate where you are guaranteed that the same instance will load the save state.
* You can store internal pointers to code or data.
* It's still a full serialization and deserialization, and could be loaded or saved at any time.
* It's still a full serialization and deserialization, and could be loaded or saved at any time.
* It won't be written to disk or sent over the network.
*/
RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_INSTANCE = 1,

/* Savestate where you are guaranteed that the same emulator binary will load that savestate.
* You can skip anything that would slow down saving or loading state but you can not store internal pointers.
* You can skip anything that would slow down saving or loading state but you can not store internal pointers.
* It won't be written to disk or sent over the network.
* Example: "Second Instance" runahead
*/
Expand Down
14 changes: 9 additions & 5 deletions menu/menu_setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
#include "../lakka.h"
#ifdef HAVE_LAKKA_SWITCH
#include "../lakka-switch.h"
#endif
#endif
#include "../retroarch.h"
#include "../gfx/video_display_server.h"
#ifdef HAVE_CHEATS
Expand Down Expand Up @@ -3183,6 +3183,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 @@ -6888,6 +6891,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 Expand Up @@ -8856,7 +8860,7 @@ static void switch_cec_enable_toggle_change_handler(rarch_setting_t *setting)
} else {
filestream_delete(SWITCH_CEC_TOGGLE_PATH);
}

}

static void bluetooth_ertm_disable_toggle_change_handler(rarch_setting_t *setting)
Expand All @@ -8870,7 +8874,7 @@ static void bluetooth_ertm_disable_toggle_change_handler(rarch_setting_t *settin
fprintf(f, "0\n");
fclose(f);
}

}
#endif

Expand Down Expand Up @@ -22017,7 +22021,7 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
(*list)[list_info->index - 1].change_handler = switch_oc_enable_toggle_change_handler;

CONFIG_BOOL(
list, list_info,
&settings->bools.switch_cec,
Expand All @@ -22033,7 +22037,7 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
(*list)[list_info->index - 1].change_handler = switch_cec_enable_toggle_change_handler;

CONFIG_BOOL(
list, list_info,
&settings->bools.bluetooth_ertm_disable,
Expand Down
19 changes: 18 additions & 1 deletion 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 Expand Up @@ -907,6 +924,6 @@ const char *msg_hash_get_wideglyph_str(void)
break;
}
#endif

return NULL;
}
1 change: 1 addition & 0 deletions msg_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -3464,6 +3464,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
13 changes: 7 additions & 6 deletions retroarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -3774,17 +3774,17 @@ bool command_event(enum event_command cmd, void *data)
netplay_server = tmp_netplay_server;
netplay_session = tmp_netplay_session;
}
if (p_rarch->connect_mitm_id)

if (p_rarch->connect_mitm_id)
netplay_session = strdup(p_rarch->connect_mitm_id);
if (p_rarch->connect_host)

if (p_rarch->connect_host)
{
free(p_rarch->connect_host);
p_rarch->connect_host = NULL;
}

if (p_rarch->connect_mitm_id)
if (p_rarch->connect_mitm_id)
{
free(p_rarch->connect_mitm_id);
p_rarch->connect_mitm_id = NULL;
Expand Down Expand Up @@ -6061,7 +6061,7 @@ static bool retroarch_parse_input_and_config(
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
p_rarch->connect_host = strdup(optarg);
break;

case 'T':
p_rarch->connect_mitm_id = strdup(optarg);
break;
Expand Down Expand Up @@ -7282,6 +7282,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 @@ -752,6 +752,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 75b4bf3

Please sign in to comment.