From c69e6a525363d435143f3725d5eb35c0ed893c9d Mon Sep 17 00:00:00 2001 From: Hominem te esse Date: Wed, 29 Feb 2012 22:53:10 +0100 Subject: [PATCH] adding i18n strings --- include/lang.h | 20 +++++++++++++++++++- lng/lang_English.lng | 20 +++++++++++++++++++- lng/lang_French.lng | 20 +++++++++++++++++++- src/dia.c | 8 ++++---- src/dialogs.c | 26 +++++++++++++------------- src/gui.c | 2 +- src/lang.c | 20 +++++++++++++++++++- src/themes.c | 7 ++++--- 8 files changed, 98 insertions(+), 25 deletions(-) diff --git a/include/lang.h b/include/lang.h index 90d0a74..d4f8ded 100644 --- a/include/lang.h +++ b/include/lang.h @@ -121,8 +121,26 @@ #define _STR_RECONNECT 116 #define _STR_HINT_SHARENAME 117 #define _STR_ETH_PREFIX 118 +#define _STR_BACKSPACE 119 +#define _STR_SPACE 120 +#define _STR_ENTER 121 +#define _STR_MODE 122 +#define _STR_VMC_SLOT1 123 +#define _STR_VMC_SLOT2 124 +#define _STR_GAME_ID 125 +#define _STR_DMA_MODE 126 +#define _STR_VSYNC 127 +#define _STR_MODE1 128 +#define _STR_MODE2 129 +#define _STR_MODE3 130 +#define _STR_MODE4 131 +#define _STR_MODE5 132 +#define _STR_MODE6 133 +#define _STR_MODE7 134 +#define _STR_MODE8 135 +#define _STR_MODE9 136 -#define LANG_STR_COUNT 119 +#define LANG_STR_COUNT 137 // Maximum external languages supported #define MAX_LANGUAGE_FILES 15 diff --git a/lng/lang_English.lng b/lng/lang_English.lng index 63da3f0..1ef1f50 100644 --- a/lng/lang_English.lng +++ b/lng/lang_English.lng @@ -146,4 +146,22 @@ Custom ELF Color selection Reconnect Leave empty to list shares -ETH prefix path \ No newline at end of file +ETH prefix path +Backspace +Space +Enter +Mode +VMC Slot 1 +VMC Slot 2 +Game ID +DMA Mode +V-Sync +Mode 1 +Mode 2 +Mode 3 +Mode 4 +Mode 5 +Mode 6 +Mode 7 +Mode 8 +Mode 9 \ No newline at end of file diff --git a/lng/lang_French.lng b/lng/lang_French.lng index 7d080a2..bb27aa5 100644 --- a/lng/lang_French.lng +++ b/lng/lang_French.lng @@ -117,4 +117,22 @@ ELF personnalisé Choix de la couleur Reconnection Laisser vide pour lister les partages -Préfixe ETH \ No newline at end of file +Préfixe ETH +Retour arrière +Espace +Entrée +Mode +Carte VMC 1 +Carte VMC 2 +ID de jeu +Mode DMA +V-Sync +Mode 1 +Mode 2 +Mode 3 +Mode 4 +Mode 5 +Mode 6 +Mode 7 +Mode 8 +Mode 9 \ No newline at end of file diff --git a/src/dia.c b/src/dia.c index 0263a2d..7594969 100644 --- a/src/dia.c +++ b/src/dia.c @@ -61,7 +61,7 @@ int diaShowKeyb(char* text, int maxLen) { 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', '~', '.' }; char *keyb = keyb0; - char *commands[KEYB_HEIGHT] = {"BACKSPACE", "SPACE", "ENTER", "MODE"}; + char *commands[KEYB_HEIGHT] = {_l(_STR_BACKSPACE), _l(_STR_SPACE), _l(_STR_ENTER), _l(_STR_MODE)}; GSTEXTURE *cmdicons[KEYB_HEIGHT]; cmdicons[0] = thmGetTexture(SQUARE_ICON); cmdicons[1] = thmGetTexture(TRIANGLE_ICON); @@ -86,7 +86,7 @@ int diaShowKeyb(char* text, int maxLen) { for (i = 0; i < KEYB_WIDTH; i++) { c[0] = keyb[i + j * KEYB_WIDTH]; - x = 50 + i * 32; + x = 50 + i * 31; w = fntRenderString(FNT_DEFAULT, x, 170 + 3 * UI_SPACING_H * j, ALIGN_NONE, 0, 0, c, gTheme->uiTextColor) - x; if ((i + j * KEYB_WIDTH) == selchar) diaDrawBoundingBox(x, 170 + 3 * UI_SPACING_H * j, w, UI_SPACING_H, 0); @@ -96,9 +96,9 @@ int diaShowKeyb(char* text, int maxLen) { // Commands for (i = 0; i < KEYB_HEIGHT; i++) { if (cmdicons[i]) - rmDrawPixmap(cmdicons[i], 448, 170 + 3 * UI_SPACING_H * i, ALIGN_NONE, cmdicons[i]->Width, cmdicons[i]->Height, SCALING_RATIO, gDefaultCol); + rmDrawPixmap(cmdicons[i], 436, 170 + 3 * UI_SPACING_H * i, ALIGN_NONE, cmdicons[i]->Width, cmdicons[i]->Height, SCALING_RATIO, gDefaultCol); - x = 489; + x = 477; w = fntRenderString(FNT_DEFAULT, x, 170 + 3 * UI_SPACING_H * i, ALIGN_NONE, 0, 0, commands[i], gTheme->uiTextColor) - x; if (i == selcommand) diaDrawBoundingBox(x, 170 + 3 * UI_SPACING_H * i, w, UI_SPACING_H, 0); diff --git a/src/dialogs.c b/src/dialogs.c index 515b6c2..d3b41b0 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -78,29 +78,29 @@ struct UIItem diaCompatConfig[] = { {UI_SPLITTER}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Mode 1", -1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE , 1, _STR_HINT_MODE1, -10, 0, {.intvalue = {0, 0}}}, {UI_SPACER}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Mode 2", -1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 1, 1, _STR_HINT_MODE2, -10, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Mode 3", -1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 2, 1, _STR_HINT_MODE3, -10, 0, {.intvalue = {0, 0}}}, {UI_SPACER}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Mode 4", -1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 3, 1, _STR_HINT_MODE4, -10, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Mode 5", -1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 4, 1, _STR_HINT_MODE5, -10, 0, {.intvalue = {0, 0}}}, {UI_SPACER}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Mode 6", -1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 5, 1, _STR_HINT_MODE6, -10, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Mode 7", -1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 6, 1, _STR_HINT_MODE7, -10, 0, {.intvalue = {0, 0}}}, {UI_SPACER}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Mode 8", -1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 7, 1, _STR_HINT_MODE8, -10, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_MODE1}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE , 1, _STR_HINT_MODE1, -10, 0, {.intvalue = {0, 0}}}, {UI_SPACER}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_MODE2}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 1, 1, _STR_HINT_MODE2, -10, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_MODE3}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 2, 1, _STR_HINT_MODE3, -10, 0, {.intvalue = {0, 0}}}, {UI_SPACER}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_MODE4}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 3, 1, _STR_HINT_MODE4, -10, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_MODE5}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 4, 1, _STR_HINT_MODE5, -10, 0, {.intvalue = {0, 0}}}, {UI_SPACER}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_MODE6}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 5, 1, _STR_HINT_MODE6, -10, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_MODE7}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 6, 1, _STR_HINT_MODE7, -10, 0, {.intvalue = {0, 0}}}, {UI_SPACER}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_MODE8}}}, {UI_SPACER}, {UI_BOOL, COMPAT_MODE_BASE + 7, 1, _STR_HINT_MODE8, -10, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, {UI_BREAK}, - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"DMA Mode", -1}}}, {UI_SPACER}, {UI_ENUM, COMPAT_DMA, 1, -1, 0, 0, {.intvalue = {0, 0}}}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_DMA_MODE}}}, {UI_SPACER}, {UI_ENUM, COMPAT_DMA, 1, -1, 0, 0, {.intvalue = {0, 0}}}, {UI_SPLITTER}, #ifdef VMC - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"VMC Slot 1", -1}}}, {UI_SPACER}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_VMC_SLOT1}}}, {UI_SPACER}, #ifndef __CHILDPROOF {UI_BUTTON, COMPAT_VMC1_DEFINE, 1, -1, 0, 0, {.label = {NULL, -1}}}, {UI_SPACER}, {UI_BUTTON, COMPAT_VMC1_ACTION, 1, -1, 0, 0, {.label = {NULL, -1}}}, {UI_BREAK}, #else {UI_BUTTON, COMPAT_VMC1_DEFINE, 0, -1, 0, 0, {.label = {NULL, -1}}}, {UI_BREAK}, #endif - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"VMC Slot 2", -1}}}, {UI_SPACER}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_VMC_SLOT2}}}, {UI_SPACER}, #ifndef __CHILDPROOF {UI_BUTTON, COMPAT_VMC2_DEFINE, 1, -1, 0, 0, {.label = {NULL, -1}}}, {UI_SPACER}, {UI_BUTTON, COMPAT_VMC2_ACTION, 1, -1, 0, 0, {.label = {NULL, -1}}}, #else @@ -110,7 +110,7 @@ struct UIItem diaCompatConfig[] = { {UI_SPLITTER}, #endif - {UI_LABEL, 0, 1, -1, 0, 0, {.label = {"Game ID", -1}}}, {UI_SPACER}, {UI_STRING, COMPAT_GAMEID, 1, -1, 0, 0, {.stringvalue = {"", "", NULL}}}, + {UI_LABEL, 0, 1, -1, 0, 0, {.label = {NULL, _STR_GAME_ID}}}, {UI_SPACER}, {UI_STRING, COMPAT_GAMEID, 1, -1, 0, 0, {.stringvalue = {"", "", NULL}}}, {UI_SPACER}, {UI_BUTTON, COMPAT_LOADFROMDISC, 1, -1, 0, 0, {.label = {NULL, _STR_LOAD_FROM_DISC}}}, {UI_SPLITTER}, @@ -196,7 +196,7 @@ struct UIItem diaUIConfig[] = { {UI_SPLITTER}, {UI_LABEL, 0, 1, -1, -20, 0, {.label = {NULL, _STR_VMODE}}}, {UI_SPACER}, {UI_ENUM, UICFG_VMODE, 1, -1, 0, 0, {.intvalue = {0, 0}}}, {UI_BREAK}, - {UI_LABEL, 0, 1, -1, -20, 0, {.label = {"V-Sync", -1}}}, {UI_SPACER}, {UI_BOOL, UICFG_VSYNC, 1, -1, 0, 0, {.intvalue = {1, 1}}}, {UI_BREAK}, + {UI_LABEL, 0, 1, -1, -20, 0, {.label = {NULL, _STR_VSYNC}}}, {UI_SPACER}, {UI_BOOL, UICFG_VSYNC, 1, -1, 0, 0, {.intvalue = {1, 1}}}, {UI_BREAK}, {UI_LABEL, 0, 1, -1, -20, 0, {.label = {NULL, _STR_WIDE_SCREEN}}}, {UI_SPACER}, {UI_BOOL, UICFG_WIDESCREEN, 1, -1, 0, 0, {.intvalue = {0, 0}}}, {UI_SPLITTER}, diff --git a/src/gui.c b/src/gui.c index fb97e8d..2ab8529 100644 --- a/src/gui.c +++ b/src/gui.c @@ -298,7 +298,7 @@ void guiShowUIConfig() { // configure the enumerations const char* scrollSpeeds[] = { _l(_STR_SLOW), _l(_STR_MEDIUM), _l(_STR_FAST), NULL }; - const char* vmodeNames[] = { "AUTO", "PAL", "NTSC", NULL }; + const char* vmodeNames[] = { _l(_STR_AUTO), "PAL", "NTSC", NULL }; diaSetEnum(diaUIConfig, UICFG_SCROLL, scrollSpeeds); diaSetEnum(diaUIConfig, UICFG_THEME, (const char **) thmGetGuiList()); diaSetEnum(diaUIConfig, UICFG_LANG, (const char **) lngGetGuiList()); diff --git a/src/lang.c b/src/lang.c index 11cd947..f9c6bb5 100644 --- a/src/lang.c +++ b/src/lang.c @@ -124,7 +124,25 @@ static char *internalEnglish[LANG_STR_COUNT] = { "Color selection", "Reconnect", "Leave empty to list shares", - "ETH prefix path" + "ETH prefix path", + "Backspace", + "Space", + "Enter", + "Mode", + "VMC Slot 1", + "VMC Slot 2", + "Game ID", + "DMA Mode", + "V-Sync", + "Mode 1", + "Mode 2", + "Mode 3", + "Mode 4", + "Mode 5", + "Mode 6", + "Mode 7", + "Mode 8", + "Mode 9" }; static int guiLangID = 0; diff --git a/src/themes.c b/src/themes.c index be3bc01..43c0e46 100644 --- a/src/themes.c +++ b/src/themes.c @@ -181,12 +181,12 @@ static void drawAttributeText(struct menu_list* menu, struct submenu_list* item, } } if (mutableText->currentValue) { - if (mutableText->displayMode == DISPLAY_NEVER) + if (mutableText->displayMode == DISPLAY_NEVER) { if (mutableText->sizingMode == SIZING_NONE) fntRenderString(elem->font, elem->posX, elem->posY, elem->aligned, 0, 0, mutableText->currentValue, elem->color); else fntRenderString(elem->font, elem->posX, elem->posY, elem->aligned, elem->width, elem->height, mutableText->currentValue, elem->color); - else { + } else { char result[300]; snprintf(result, 300, "%s%s", mutableText->alias, mutableText->currentValue); if (mutableText->sizingMode == SIZING_NONE) @@ -197,11 +197,12 @@ static void drawAttributeText(struct menu_list* menu, struct submenu_list* item, return; } } - if (mutableText->displayMode == DISPLAY_ALWAYS) + if (mutableText->displayMode == DISPLAY_ALWAYS) { if (mutableText->sizingMode == SIZING_NONE) fntRenderString(elem->font, elem->posX, elem->posY, elem->aligned, 0, 0, mutableText->alias, elem->color); else fntRenderString(elem->font, elem->posX, elem->posY, elem->aligned, elem->width, elem->height, mutableText->alias, elem->color); + } } static void initAttributeText(char* themePath, config_set_t* themeConfig, theme_t* theme, theme_element_t* elem, char* name, -- 2.11.4.GIT