Localization improvements. (#14753)

- enable localization of audio mixer sublabel
- resolve 2 localization FIXME items
- enable better localization of controller connect/disconnect/config messages
This commit is contained in:
zoltanvb 2022-12-22 16:54:14 +01:00 committed by GitHub
parent dbe5a047c4
commit 1334bd0408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 94 additions and 64 deletions

View File

@ -2424,6 +2424,26 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_MIXER_ACTION_VOLUME,
"Adjust the volume of the audio stream."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_NONE,
"State : N/A"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_STOPPED,
"State : Stopped"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING,
"State : Playing"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING_LOOPED,
"State : Playing (Looped)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL,
"State : Playing (Sequential)"
)
/* Settings > Audio > Menu Sounds */
@ -11277,6 +11297,10 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_SUBSYSTEM_SETTINGS,
"Access subsystem settings for current content."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SUBSYSTEM_CONTENT_INFO,
" Current Content: %s"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_NO_NETPLAY_HOSTS_FOUND,
"No netplay hosts found."
@ -11309,6 +11333,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_PORT_DEVICE_NAME,
"Port %d device name: %s (#%d)"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PORT_DEVICE_INFO,
"Device display name: %s\nDevice config name: %s\nDevice VID/PID: %d/%d"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEAT_SETTINGS,
"Cheat Settings"
@ -13114,18 +13142,34 @@ MSG_HASH(
MSG_DEVICE_CONFIGURED_IN_PORT,
"configured in port"
)
MSG_HASH(
MSG_DEVICE_CONFIGURED_IN_PORT_NR,
"%s configured in port %u"
)
MSG_HASH(
MSG_DEVICE_DISCONNECTED_FROM_PORT,
"disconnected from port"
)
MSG_HASH(
MSG_DEVICE_DISCONNECTED_FROM_PORT_NR,
"%s disconnected from port %u"
)
MSG_HASH(
MSG_DEVICE_NOT_CONFIGURED,
"not configured"
)
MSG_HASH(
MSG_DEVICE_NOT_CONFIGURED_NR,
"%s (%u/%u) not configured"
)
MSG_HASH(
MSG_DEVICE_NOT_CONFIGURED_FALLBACK,
"not configured, using fallback"
)
MSG_HASH(
MSG_DEVICE_NOT_CONFIGURED_FALLBACK_NR,
"%s (%u/%u) not configured, using fallback"
)
MSG_HASH(
MSG_BLUETOOTH_SCAN_COMPLETE,
"Bluetooth scan complete."

View File

@ -1241,8 +1241,7 @@ static int action_bind_sublabel_systeminfo_controller_entry(
}
}
/* TODO/FIXME - Localize */
snprintf(tmp, sizeof(tmp), "Device display name: %s\nDevice config name: %s\nDevice VID/PID: %d/%d",
snprintf(tmp, sizeof(tmp), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PORT_DEVICE_INFO),
input_config_get_device_display_name(controller) ? input_config_get_device_display_name(controller) : msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
input_config_get_device_display_name(controller) ? input_config_get_device_config_name(controller) : msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
input_config_get_device_vid(controller), input_config_get_device_pid(controller));
@ -1329,9 +1328,8 @@ static int action_bind_sublabel_subsystem_add(
if (subsystem && runloop_st->subsystem_current_count > 0)
{
/* TODO/FIXME - Localize */
if (content_get_subsystem_rom_id() < subsystem->num_roms)
snprintf(s, len, " Current Content: %s",
snprintf(s, len, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SUBSYSTEM_CONTENT_INFO),
content_get_subsystem() == type - MENU_SETTINGS_SUBSYSTEM_ADD
? subsystem->roms[content_get_subsystem_rom_id()].desc
: subsystem->roms[0].desc);
@ -1419,29 +1417,32 @@ static int action_bind_sublabel_audio_mixer_stream(
{
case AUDIO_STREAM_STATE_NONE:
strlcpy(msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_NONE),
sizeof(msg));
break;
case AUDIO_STREAM_STATE_STOPPED:
/* TODO/FIXME - Localize */
strlcpy(msg, "Stopped", sizeof(msg));
strlcpy(msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_STOPPED),
sizeof(msg));
break;
case AUDIO_STREAM_STATE_PLAYING:
/* TODO/FIXME - Localize */
strlcpy(msg, "Playing", sizeof(msg));
strlcpy(msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING),
sizeof(msg));
break;
case AUDIO_STREAM_STATE_PLAYING_LOOPED:
/* TODO/FIXME - Localize */
strlcpy(msg, "Playing (Looped)", sizeof(msg));
strlcpy(msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING_LOOPED),
sizeof(msg));
break;
case AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL:
/* TODO/FIXME - Localize */
strlcpy(msg, "Playing (Sequential)", sizeof(msg));
strlcpy(msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL),
sizeof(msg));
break;
}
/* TODO/FIXME - Localize */
snprintf(s, len, "State : %s | %s: %.2f dB", msg,
snprintf(s, len, "%s | %s: %.2f dB", msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MIXER_ACTION_VOLUME),
stream->volume);
return 0;

View File

@ -1787,7 +1787,7 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
{
snprintf(tmp, sizeof(tmp),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PORT_DEVICE_NAME),
controller,
controller+1,
input_config_get_device_name(controller),
input_config_get_device_name_index(controller));

View File

@ -244,10 +244,14 @@ enum msg_hash_enums
MSG_AUDIO_MIXER_VOLUME,
MSG_LIBRETRO_FRONTEND,
MSG_CAPABILITIES,
MSG_DEVICE_CONFIGURED_IN_PORT,
MSG_DEVICE_NOT_CONFIGURED,
MSG_DEVICE_NOT_CONFIGURED_FALLBACK,
MSG_DEVICE_DISCONNECTED_FROM_PORT,
MSG_DEVICE_CONFIGURED_IN_PORT, /* deprecated */
MSG_DEVICE_CONFIGURED_IN_PORT_NR,
MSG_DEVICE_NOT_CONFIGURED, /* deprecated */
MSG_DEVICE_NOT_CONFIGURED_NR,
MSG_DEVICE_NOT_CONFIGURED_FALLBACK, /* deprecated */
MSG_DEVICE_NOT_CONFIGURED_FALLBACK_NR,
MSG_DEVICE_DISCONNECTED_FROM_PORT, /* deprecated */
MSG_DEVICE_DISCONNECTED_FROM_PORT_NR,
MSG_NO_ARGUMENTS_SUPPLIED_AND_NO_MENU_BUILTIN,
MSG_COMPILER,
MSG_NATIVE,
@ -285,8 +289,8 @@ enum msg_hash_enums
MSG_CONNECT_DEVICE_FROM_A_VALID_PORT,
MSG_VALUE_CONNECT_DEVICE_FROM_A_VALID_PORT,
MSG_DISCONNECT_DEVICE_FROM_A_VALID_PORT,
MSG_DISCONNECTING_DEVICE_FROM_PORT,
MSG_VALUE_DISCONNECTING_DEVICE_FROM_PORT,
MSG_DISCONNECTING_DEVICE_FROM_PORT, /* deprecated */
MSG_VALUE_DISCONNECTING_DEVICE_FROM_PORT, /* deprecated */
MSG_BRINGING_UP_COMMAND_INTERFACE_ON_PORT,
MSG_FAILED_TO_ACCEPT_INCOMING_SPECTATOR,
MSG_FAILED_TO_GET_NICKNAME_FROM_CLIENT,
@ -567,6 +571,11 @@ enum msg_hash_enums
MENU_LABEL(ADD_TO_MIXER_AND_PLAY),
MENU_LABEL(ADD_TO_MIXER_AND_COLLECTION),
MENU_LABEL(ADD_TO_MIXER_AND_COLLECTION_AND_PLAY),
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_NONE,
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_STOPPED,
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING,
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING_LOOPED,
MENU_ENUM_LABEL_VALUE_AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL,
MENU_LABEL(TWITCH_STREAM_KEY),
MENU_LABEL(YOUTUBE_STREAM_KEY),
MENU_LABEL(FACEBOOK_STREAM_KEY),
@ -1564,6 +1573,7 @@ enum msg_hash_enums
MENU_LABEL(PRIVACY_SETTINGS),
MENU_LABEL(MIDI_SETTINGS),
MENU_LABEL(SUBSYSTEM_SETTINGS),
MENU_ENUM_LABEL_VALUE_SUBSYSTEM_CONTENT_INFO,
MENU_LABEL(NETWORK_HOSTING_SETTINGS),
MENU_LABEL(NETWORK_SETTINGS),
MENU_LABEL(NETPLAY_LOBBY_FILTERS),
@ -2968,6 +2978,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_PORT,
MENU_ENUM_LABEL_VALUE_PORT_DEVICE_NAME,
MENU_ENUM_LABEL_VALUE_PORT_DEVICE_INFO,
MENU_ENUM_LABEL_VALUE_LEFT_ANALOG,
MENU_ENUM_LABEL_VALUE_RIGHT_ANALOG,

View File

@ -533,16 +533,9 @@ static void input_autoconfigure_connect_handler(retro_task_t *task)
/* A valid autoconfig was applied */
if (!(autoconfig_handle->flags & AUTOCONF_FLAG_SUPPRESS_NOTIFICATIONS))
{
size_t _len = strlcpy(task_title,
device_display_name, sizeof(task_title));
task_title[_len ] = ' ';
task_title[++_len] = '\0';
_len = strlcat(task_title,
msg_hash_to_str(MSG_DEVICE_CONFIGURED_IN_PORT),
sizeof(task_title));
task_title[_len ] = ' ';
task_title[++_len] = '\0';
snprintf(task_title + _len, sizeof(task_title) - _len, "%u",
snprintf(task_title, sizeof(task_title),
msg_hash_to_str(MSG_DEVICE_CONFIGURED_IN_PORT_NR),
device_display_name,
autoconfig_handle->port + 1);
}
}
@ -550,33 +543,21 @@ static void input_autoconfigure_connect_handler(retro_task_t *task)
* incorrect) fallback definition was used... */
else
{
size_t _len = strlcpy(task_title,
device_display_name, sizeof(task_title));
task_title[_len ] = ' ';
task_title[++_len] = '(';
task_title[++_len] = '\0';
snprintf(task_title + _len, sizeof(task_title) - _len, "%u/%u) ",
autoconfig_handle->device_info.vid,
autoconfig_handle->device_info.pid);
strlcat(task_title,
msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED_FALLBACK),
sizeof(task_title));
snprintf(task_title, sizeof(task_title),
msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED_FALLBACK_NR),
device_display_name,
autoconfig_handle->device_info.vid,
autoconfig_handle->device_info.pid);
}
}
/* Autoconfig failed */
else
{
size_t _len = strlcpy(task_title,
device_display_name, sizeof(task_title));
task_title[_len ] = ' ';
task_title[++_len] = '(';
task_title[++_len] = '\0';
snprintf(task_title + _len, sizeof(task_title) - _len, "%u/%u) ",
autoconfig_handle->device_info.vid,
autoconfig_handle->device_info.pid);
strlcat(task_title,
msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED),
sizeof(task_title));
snprintf(task_title, sizeof(task_title),
msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED_NR),
device_display_name,
autoconfig_handle->device_info.vid,
autoconfig_handle->device_info.pid);
}
/* Update task title */
@ -824,16 +805,9 @@ static void input_autoconfigure_disconnect_handler(retro_task_t *task)
device_display_name = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE);
/* Set task title */
_len = strlcpy(task_title,
device_display_name, sizeof(task_title));
task_title[_len ] = ' ';
task_title[++_len] = '\0';
_len = strlcat(task_title,
msg_hash_to_str(MSG_DEVICE_DISCONNECTED_FROM_PORT),
sizeof(task_title));
task_title[_len ] = ' ';
task_title[++_len] = '\0';
snprintf(task_title + _len, sizeof(task_title) - _len, "%u",
snprintf(task_title, sizeof(task_title),
msg_hash_to_str(MSG_DEVICE_DISCONNECTED_FROM_PORT_NR),
device_display_name,
autoconfig_handle->port + 1);
task_free_title(task);