diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 45aa5cd056..585c68a73c 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -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." diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index b890c62f42..504c842eeb 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -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; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index b05a384b8e..dc13f415e6 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -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)); diff --git a/msg_hash.h b/msg_hash.h index 966373d7de..542fcafdb5 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -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, diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index dafaac59e9..eb4febdb34 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -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);