diff --git a/config.def.h b/config.def.h index d225f1ae01..1bf9a96bf8 100644 --- a/config.def.h +++ b/config.def.h @@ -1053,6 +1053,10 @@ static char buildbot_assets_server_url[] = "http://buildbot.libretro.com/assets/ static char default_discord_app_id[] = "475456035851599874"; +#define DEFAULT_AI_SERVICE_SOURCE_LANG 0 + +#define DEFAULT_AI_SERVICE_TARGET_LANG 0 + #define DEFAULT_AI_SERVICE_ENABLE false #define DEFAULT_AI_SERVICE_MODE 1 diff --git a/configuration.c b/configuration.c index 3961e18b35..b4506db0a9 100644 --- a/configuration.c +++ b/configuration.c @@ -1826,6 +1826,8 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, DEFAULT_WINDOW_WIDTH, false); SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, DEFAULT_WINDOW_HEIGHT, false); SETTING_UINT("ai_service_mode", &settings->uints.ai_service_mode, DEFAULT_AI_SERVICE_MODE, 0, false); + SETTING_UINT("ai_service_target_lang", &settings->uints.ai_service_target_lang, 0, 0, false); + SETTING_UINT("ai_service_source_lang", &settings->uints.ai_service_source_lang, 0, 0, false); SETTING_UINT("video_record_threads", &settings->uints.video_record_threads, true, DEFAULT_VIDEO_RECORD_THREADS, false); diff --git a/configuration.h b/configuration.h index 73350f076d..1cdb6e9000 100644 --- a/configuration.h +++ b/configuration.h @@ -547,6 +547,8 @@ typedef struct settings unsigned libnx_overclock; unsigned ai_service_mode; + unsigned ai_service_target_lang; + unsigned ai_service_source_lang; } uints; struct diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index 03317c8983..b861b7c53d 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3882,3 +3882,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 222710fbdb..ddec1de8ac 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -4900,3 +4900,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 6342b01b41..29d83ff226 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3658,3 +3658,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index d17606342d..4e72c2c26a 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3787,3 +3787,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_el.h b/intl/msg_hash_el.h index edf813b75b..bf796b41c0 100644 --- a/intl/msg_hash_el.h +++ b/intl/msg_hash_el.h @@ -7864,3 +7864,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index f7c2e095a3..6289b8bbe4 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3546,3 +3546,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index 16ed8f29ad..f20d090855 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -8016,3 +8016,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index cbf2c0ff4d..0c162f1890 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -8804,3 +8804,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 5e55c5033e..8e4bfba04d 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3767,3 +3767,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 0ec02a5087..a2ed8492e1 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -9179,3 +9179,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index a0030f4e10..09a149bb38 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -9011,3 +9011,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 24bda6a3db..e0bcf87e66 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -2001,3 +2001,7 @@ MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_URL, "ai_service_url") MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_ENABLE, "ai_service_enable") +MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_TARGET_LANG, + "ai_service_target_lang") +MSG_HASH(MENU_ENUM_LABEL_AI_SERVICE_SOURCE_LANG, + "ai_service_source_lang") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 1f42319d19..0b5124d0d0 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3540,3 +3540,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index f9f3f85866..7ef4444d4b 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -4331,3 +4331,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 3f68055dbd..e8ad50b95e 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -9091,3 +9091,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 1111583a40..82d456f5b0 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3612,3 +3612,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index d88450018d..dae53256a9 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3810,3 +3810,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_tr.h b/intl/msg_hash_tr.h index 8c92c7b2b7..203602b4c4 100644 --- a/intl/msg_hash_tr.h +++ b/intl/msg_hash_tr.h @@ -8816,3 +8816,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 647bdf0ea5..c4bad9ceb7 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -9155,3 +9155,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 270e262be6..a8ef708600 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3702,3 +3702,11 @@ MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_URL, "A http:// url pointing to the translation service to use.") MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE, "Enable AI Service to run when the AI Service hotkey is pressed.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + "Target Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG, + "The language the service will translate to. If set to 'Don't Care', it will default to English.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + "Source Language") +MSG_HASH(MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG, + "The language the service will translate from. If set to 'Don't Care', it will attempt to auto-detect the language. Setting it to a specific language will make the translation more accurate.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index a2b0a3c861..56fd5845d2 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -127,6 +127,8 @@ default_sublabel_macro(action_bind_sublabel_logging_settings_list, MENU_ default_sublabel_macro(action_bind_sublabel_user_interface_settings_list, MENU_ENUM_SUBLABEL_USER_INTERFACE_SETTINGS) default_sublabel_macro(action_bind_sublabel_ai_service_settings_list, MENU_ENUM_SUBLABEL_AI_SERVICE_SETTINGS) default_sublabel_macro(action_bind_sublabel_ai_service_mode, MENU_ENUM_SUBLABEL_AI_SERVICE_MODE) +default_sublabel_macro(action_bind_sublabel_ai_service_target_lang, MENU_ENUM_SUBLABEL_AI_SERVICE_TARGET_LANG) +default_sublabel_macro(action_bind_sublabel_ai_service_source_lang, MENU_ENUM_SUBLABEL_AI_SERVICE_SOURCE_LANG) default_sublabel_macro(action_bind_sublabel_ai_service_url, MENU_ENUM_SUBLABEL_AI_SERVICE_URL) default_sublabel_macro(action_bind_sublabel_ai_service_enable, MENU_ENUM_SUBLABEL_AI_SERVICE_ENABLE) default_sublabel_macro(action_bind_sublabel_power_management_settings_list, MENU_ENUM_SUBLABEL_POWER_MANAGEMENT_SETTINGS) @@ -2547,6 +2549,12 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_AI_SERVICE_URL: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ai_service_url); break; + case MENU_ENUM_LABEL_AI_SERVICE_TARGET_LANG: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ai_service_target_lang); + break; + case MENU_ENUM_LABEL_AI_SERVICE_SOURCE_LANG: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ai_service_source_lang); + break; case MENU_ENUM_LABEL_AI_SERVICE_MODE: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ai_service_mode); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 54808bdf4b..badb404073 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3726,6 +3726,8 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct {MENU_ENUM_LABEL_AI_SERVICE_MODE, PARSE_ONLY_UINT, true }, {MENU_ENUM_LABEL_AI_SERVICE_URL, PARSE_ONLY_STRING, true }, {MENU_ENUM_LABEL_AI_SERVICE_ENABLE, PARSE_ONLY_BOOL, true}, + {MENU_ENUM_LABEL_AI_SERVICE_SOURCE_LANG, PARSE_ONLY_UINT, true}, + {MENU_ENUM_LABEL_AI_SERVICE_TARGET_LANG, PARSE_ONLY_UINT, true}, }; for (i = 0; i < ARRAY_SIZE(build_list); i++) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index ac1a866aa5..a2c5f21862 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -56,6 +56,10 @@ #include "../cheevos-new/cheevos.h" #endif +#ifdef HAVE_TRANSLATE +#include "../translation/translation_driver.h" +#endif + #include "../frontend/frontend_driver.h" #include "widgets/menu_input_bind_dialog.h" @@ -12848,6 +12852,7 @@ static bool setting_append_list( END_GROUP(list, list_info, parent_group); break; case SETTINGS_LIST_AI_SERVICE: +#ifdef HAVE_TRANSLATE START_GROUP(list, list_info, &group_info, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_AI_SERVICE_SETTINGS), parent_group); @@ -12900,8 +12905,37 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); + CONFIG_UINT( + list, list_info, + &settings->uints.ai_service_source_lang, + MENU_ENUM_LABEL_AI_SERVICE_SOURCE_LANG, + MENU_ENUM_LABEL_VALUE_AI_SERVICE_SOURCE_LANG, + DEFAULT_AI_SERVICE_SOURCE_LANG, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler); + (*list)[list_info->index - 1].action_ok = &setting_action_ok_uint; + menu_settings_list_current_add_range(list, list_info, TRANSLATION_LANG_DONT_CARE, (TRANSLATION_LANG_LAST-1), 1, true, true); + + CONFIG_UINT( + list, list_info, + &settings->uints.ai_service_target_lang, + MENU_ENUM_LABEL_AI_SERVICE_TARGET_LANG, + MENU_ENUM_LABEL_VALUE_AI_SERVICE_TARGET_LANG, + DEFAULT_AI_SERVICE_TARGET_LANG, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler); + (*list)[list_info->index - 1].action_ok = &setting_action_ok_uint; + menu_settings_list_current_add_range(list, list_info, TRANSLATION_LANG_DONT_CARE, (TRANSLATION_LANG_LAST-1), 1, true, true); + END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group); +#endif break; case SETTINGS_LIST_USER_INTERFACE: START_GROUP(list, list_info, &group_info, diff --git a/msg_hash.h b/msg_hash.h index c9137543f0..8a4e2bbde5 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1670,6 +1670,8 @@ enum msg_hash_enums MENU_LABEL(INPUT_SETTINGS), MENU_LABEL(AI_SERVICE_SETTINGS), MENU_LABEL(AI_SERVICE_MODE), + MENU_LABEL(AI_SERVICE_TARGET_LANG), + MENU_LABEL(AI_SERVICE_SOURCE_LANG), MENU_LABEL(AI_SERVICE_URL), MENU_LABEL(AI_SERVICE_ENABLE), diff --git a/translation/translation_driver.h b/translation/translation_driver.h index 0ca2508337..e100a7a4e5 100644 --- a/translation/translation_driver.h +++ b/translation/translation_driver.h @@ -82,7 +82,8 @@ enum translation_lang TRANSLATION_LANG_UR, /* Urdu */ TRANSLATION_LANG_VI, /* Vietnamese */ TRANSLATION_LANG_CY, /* Welsh */ - TRANSLATION_LANG_YI /* Yiddish */ + TRANSLATION_LANG_YI, /* Yiddish */ + TRANSLATION_LANG_LAST }; struct translation_driver_info