From 20f50bbca360b5c772299cedaaa30c1a45456c2a Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 7 Jun 2024 17:44:01 -0400 Subject: plugins: mikmod and chessbox weren't fully translated This unfortunately required adding four more strings. Change-Id: I656c3c4902de5f841ea742549b3d122463e399a8 --- apps/lang/english.lang | 57 ++++++++++++++++++++++++++++++++++++++++ apps/plugins/chessbox/chessbox.c | 4 +-- apps/plugins/mikmod/mikmod.c | 57 +++++++++++++++++++++++----------------- 3 files changed, 92 insertions(+), 26 deletions(-) diff --git a/apps/lang/english.lang b/apps/lang/english.lang index a93cff90ec..2303af5c4c 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -16388,3 +16388,60 @@ *: "Legal Notices" + + id: LANG_ERROR_FORMATSTR + desc: for general use + user: core + + *: "Error: %s" + + + *: "Error: %s" + + + *: "Error" + + + + id: LANG_MIKMOD_SETTINGS + desc: mikmod plugin + user: core + + *: "Mikmod Settings" + + + *: "Mikmod Settings" + + + *: "Mik mod Settings" + + + + id: LANG_MIKMOD_MENU + desc: mikmod plugin + user: core + + *: "Mikmod Menu" + + + *: "Mikmod Menu" + + + *: "Mik mod Menu" + + + + id: LANG_CHESSBOX_MENU + desc: chessbox plugin + user: core + + *: "Chessbox Menu" + + + *: "Chessbox Menu" + + + *: "Chess box Menu" + + + diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 089cf7c400..a283be3cda 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c @@ -555,7 +555,7 @@ static int cb_menu_viewer(void) { int selection; - MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL, + MENUITEM_STRINGLIST(menu, ID2P(LANG_CHESSBOX_MENU), NULL, ID2P(LANG_CHESSBOX_MENU_RESTART_GAME), ID2P(LANG_CHESSBOX_MENU_SELECT_OTHER_GAME), ID2P(LANG_CHESSBOX_MENU_RESUME_GAME), @@ -800,7 +800,7 @@ static int cb_menu(void) { int selection; - MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL, + MENUITEM_STRINGLIST(menu,ID2P(LANG_CHESSBOX_MENU), NULL, ID2P(LANG_CHESSBOX_MENU_NEW_GAME), ID2P(LANG_CHESSBOX_MENU_RESUME_GAME), ID2P(LANG_CHESSBOX_MENU_SAVE_GAME), diff --git a/apps/plugins/mikmod/mikmod.c b/apps/plugins/mikmod/mikmod.c index 5179848549..089c338308 100644 --- a/apps/plugins/mikmod/mikmod.c +++ b/apps/plugins/mikmod/mikmod.c @@ -236,7 +236,7 @@ static int change_filename(int direct) if (entries == 0) { - rb->splash(HZ, "No supported files"); + rb->splash(HZ, ID2P(LANG_NO_FILES)); return PLUGIN_ERROR; } @@ -491,20 +491,6 @@ static struct mikmod_settings settings = static struct mikmod_settings old_settings; -static const struct configdata config[] = -{ - { TYPE_INT, 0, 128, { .int_p = &settings.pansep }, "Panning Separation", NULL}, - { TYPE_INT, 0, 15, { .int_p = &settings.reverb }, "Reverberation", NULL}, - { TYPE_BOOL, 0, 1, { .bool_p = &settings.interp }, "Interpolation", NULL}, - { TYPE_BOOL, 0, 1, { .bool_p = &settings.reverse }, "Reverse Channels", NULL}, - { TYPE_BOOL, 0, 1, { .bool_p = &settings.surround }, "Surround", NULL}, - { TYPE_BOOL, 0, 1, { .bool_p = &settings.hqmixer }, "HQ Mixer", NULL}, - { TYPE_INT, 0, HW_NUM_FREQ-1, { .int_p = &settings.sample_rate }, "Sample Rate", NULL}, -#ifdef HAVE_ADJUSTABLE_CPU_FREQ - { TYPE_BOOL, 0, 1, { .bool_p = &settings.boost }, "CPU Boost", NULL}, -#endif -}; - static void applysettings(void) { md_pansep = settings.pansep; @@ -570,7 +556,7 @@ static int settings_menu(void) { int selection = 0; - MENUITEM_STRINGLIST(settings_menu, "Mikmod Settings", NULL, + MENUITEM_STRINGLIST(settings_menu, ID2P(LANG_MIKMOD_SETTINGS), NULL, ID2P(LANG_PANNING_SEPARATION), ID2P(LANG_REVERBERATION), ID2P(LANG_INTERPOLATION), @@ -582,7 +568,6 @@ static int settings_menu(void) ID2P(LANG_CPU_BOOST) #endif ); - do { selection=rb->do_menu(&settings_menu,&selection, NULL, false); @@ -650,7 +635,7 @@ static int main_menu(void) int selection = 0; int result; - MENUITEM_STRINGLIST(main_menu,"Mikmod Main Menu",NULL, + MENUITEM_STRINGLIST(main_menu,ID2P(LANG_MIKMOD_MENU), NULL, ID2P(LANG_SETTINGS), ID2P(LANG_RETURN), ID2P(LANG_MENU_QUIT)); @@ -704,7 +689,12 @@ static void thread(void) static void mm_errorhandler(void) { - rb->splashf(HZ, "%s", MikMod_strerror(MikMod_errno)); + if (rb->global_settings->talk_menu) { + rb->talk_id(LANG_ERROR_FORMATSTR, true); + rb->talk_value_decimal(MikMod_errno, UNIT_INT, 0, true); + rb->talk_force_enqueue_next(); + } + rb->splashf(HZ, rb->str(LANG_ERROR_FORMATSTR), MikMod_strerror(MikMod_errno)); quit = true; } @@ -717,13 +707,18 @@ static int playfile(char* filename) playingtime = 0; - rb->splashf(HZ, "Loading %s", filename); + if (rb->global_settings->talk_menu) { + rb->talk_id(LANG_WAIT, true); + rb->talk_file_or_spell(NULL, filename, NULL, true); + rb->talk_force_enqueue_next(); + } + rb->splashf(HZ, "%s %s", rb->str(LANG_WAIT), filename); module = Player_Load(filename, 64, 0); if (!module) { - rb->splashf(HZ, "%s", MikMod_strerror(MikMod_errno)); + mm_errorhandler(); retval = PLUGIN_ERROR; quit = true; } @@ -745,7 +740,7 @@ static int playfile(char* filename) IF_PRIO(, PRIORITY_PLAYBACK) IF_COP(, CPU))) == 0) { - rb->splash(HZ, "Cannot create thread!"); + rb->splashf(HZ, ID2P(LANG_ERROR_FORMATSTR), "Cannot create thread!"); return PLUGIN_ERROR; } #endif @@ -925,9 +920,23 @@ enum plugin_status plugin_start(const void* parameter) enum plugin_status retval; int orig_samplerate = rb->mixer_get_frequency(); + const struct configdata config[] = + { + { TYPE_INT, 0, 128, { .int_p = &settings.pansep }, rb->str(LANG_PANNING_SEPARATION), NULL}, + { TYPE_INT, 0, 15, { .int_p = &settings.reverb }, rb->str(LANG_REVERBERATION), NULL}, + { TYPE_BOOL, 0, 1, { .bool_p = &settings.interp }, rb->str(LANG_INTERPOLATION), NULL}, + { TYPE_BOOL, 0, 1, { .bool_p = &settings.reverse }, rb->str(LANG_SWAP_CHANNELS), NULL}, + { TYPE_BOOL, 0, 1, { .bool_p = &settings.surround }, rb->str(LANG_MIKMOD_SURROUND), NULL}, + { TYPE_BOOL, 0, 1, { .bool_p = &settings.hqmixer }, rb->str(LANG_MIKMOD_HQMIXER), NULL}, + { TYPE_INT, 0, HW_NUM_FREQ-1, { .int_p = &settings.sample_rate }, rb->str(LANG_MIKMOD_SAMPLERATE), NULL}, +#ifdef HAVE_ADJUSTABLE_CPU_FREQ + { TYPE_BOOL, 0, 1, { .bool_p = &settings.boost }, rb->str(LANG_CPU_BOOST), NULL}, +#endif + }; + if (parameter == NULL) { - rb->splash(HZ*2, " Play .mod, .it, .s3m, .xm file "); + rb->splash(HZ*2, ID2P(LANG_NO_FILES)); return PLUGIN_OK; } @@ -978,7 +987,7 @@ enum plugin_status plugin_start(const void* parameter) if (MikMod_Init("")) { - rb->splashf(HZ, "%s", MikMod_strerror(MikMod_errno)); + mm_errorhandler(); return PLUGIN_ERROR; } -- cgit v1.2.3