chore: improve translation string management (#6502)
This commit is contained in:
@@ -90,9 +90,12 @@ void menuModelCurveOne(event_t event)
|
||||
CurveHeader & crv = g_model.curves[s_currIdxSubMenu];
|
||||
int8_t * points = curveAddress(s_currIdxSubMenu);
|
||||
|
||||
drawStringWithIndex(PSIZE(TR_MENUCURVES)*FW+FW, 0, "CV", s_currIdxSubMenu+1);
|
||||
drawStringWithIndex(strlen(STR_MENUCURVES)*FW+FW, 0, "CV", s_currIdxSubMenu+1);
|
||||
|
||||
lcdDrawText(11*FW+FW/2, 0, TR_PT "\002X\006Y");
|
||||
char str[10];
|
||||
char* s = strAppend(str, STR_PT);
|
||||
strAppend(s, "\002X\006Y");
|
||||
lcdDrawText(11*FW+FW/2, 0, str);
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
|
||||
@@ -53,7 +53,7 @@ void menuModelCustomScriptOne(event_t event)
|
||||
{
|
||||
ScriptData & sd = g_model.scriptsData[s_currIdx];
|
||||
|
||||
drawStringWithIndex(PSIZE(TR_MENUCUSTOMSCRIPTS)*FW+FW, 0, "LUA", s_currIdx+1, 0);
|
||||
drawStringWithIndex(strlen(STR_MENUCUSTOMSCRIPTS)*FW+FW, 0, "LUA", s_currIdx+1, 0);
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
@@ -84,7 +84,7 @@ void menuModelCustomScriptOne(event_t event)
|
||||
}
|
||||
}
|
||||
else if (i == ITEM_MODEL_CUSTOMSCRIPT_NAME) {
|
||||
lcdDrawTextAlignedLeft(y, TR_NAME);
|
||||
lcdDrawTextAlignedLeft(y, STR_NAME);
|
||||
editName(SCRIPT_ONE_2ND_COLUMN_POS, y, sd.name, sizeof(sd.name), event,
|
||||
(attr != 0), attr, old_editMode);
|
||||
} else if (i == ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL) {
|
||||
|
||||
@@ -72,7 +72,7 @@ void menuModelGVarOne(event_t event)
|
||||
{
|
||||
GVarData * gvar = &g_model.gvars[s_currIdx];
|
||||
|
||||
drawStringWithIndex(PSIZE(TR_GVARS)*FW+FW, 0, STR_GV, s_currIdx+1, 0);
|
||||
drawStringWithIndex(strlen(STR_GVARS)*FW+FW, 0, STR_GV, s_currIdx+1, 0);
|
||||
drawGVarValue(32*FW, 0, s_currIdx, getGVarValue(s_currIdx, getFlightMode()));
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ void menuModelExpoOne(event_t event)
|
||||
}
|
||||
|
||||
ExpoData * ed = expoAddress(s_currIdx);
|
||||
drawSource(PSIZE(TR_MENUINPUTS)*FW+FW, 0, MIXSRC_FIRST_INPUT+ed->chn, 0);
|
||||
drawSource(strlen(STR_MENUINPUTS)*FW+FW, 0, MIXSRC_FIRST_INPUT+ed->chn, 0);
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
|
||||
@@ -98,7 +98,7 @@ void menuModelMixOne(event_t event)
|
||||
}
|
||||
|
||||
MixData * md2 = mixAddress(s_currIdx) ;
|
||||
putsChn(PSIZE(TR_MIXES)*FW+FW, 0, md2->destCh+1,0);
|
||||
putsChn(strlen(STR_MIXES)*FW+FW, 0, md2->destCh+1,0);
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
|
||||
@@ -1199,18 +1199,18 @@ void menuModelSetup(event_t event)
|
||||
MODULE_SUBTYPE_R9M_EU) {
|
||||
POPUP_WARNING(STR_MODULE_PROTOCOL_FLEX_WARN_LINE1);
|
||||
SET_WARNING_INFO(STR_MODULE_PROTOCOL_WARN_LINE2,
|
||||
sizeof(TR_MODULE_PROTOCOL_WARN_LINE2) - 1, 0);
|
||||
strlen(STR_MODULE_PROTOCOL_WARN_LINE2), 0);
|
||||
}
|
||||
#if POPUP_LEVEL >= 3
|
||||
else if (g_model.moduleData[EXTERNAL_MODULE].subType ==
|
||||
MODULE_SUBTYPE_R9M_EU) {
|
||||
POPUP_WARNING(STR_MODULE_PROTOCOL_EU_WARN_LINE1);
|
||||
SET_WARNING_INFO(STR_MODULE_PROTOCOL_WARN_LINE2,
|
||||
sizeof(TR_MODULE_PROTOCOL_WARN_LINE2) - 1, 0);
|
||||
strlen(TR_MODULE_PROTOCOL_WARN_LINE2), 0);
|
||||
} else {
|
||||
POPUP_WARNING(STR_MODULE_PROTOCOL_FCC_WARN_LINE1);
|
||||
SET_WARNING_INFO(STR_MODULE_PROTOCOL_WARN_LINE2,
|
||||
sizeof(TR_MODULE_PROTOCOL_WARN_LINE2) - 1, 0);
|
||||
strlen(TR_MODULE_PROTOCOL_WARN_LINE2), 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1358,7 +1358,7 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
if (bluetooth.distantAddr[0]) {
|
||||
lcdDrawText(INDENT_WIDTH, y+1, bluetooth.distantAddr, TINSIZE);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON(TR_CLEAR), attr);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CLEAR, attr);
|
||||
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
bluetooth.state = BLUETOOTH_STATE_CLEAR_REQUESTED;
|
||||
memclear(bluetooth.distantAddr, sizeof(bluetooth.distantAddr));
|
||||
@@ -1369,7 +1369,7 @@ void menuModelSetup(event_t event)
|
||||
if (bluetooth.state < BLUETOOTH_STATE_IDLE)
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_BUTTON_INIT, attr);
|
||||
else
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON(TR_DISCOVER), attr);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_DISCOVER, attr);
|
||||
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
if (bluetooth.state < BLUETOOTH_STATE_IDLE) {
|
||||
bluetooth.state = BLUETOOTH_STATE_OFF;
|
||||
@@ -1900,7 +1900,7 @@ void menuModelSetup(event_t event)
|
||||
{
|
||||
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
|
||||
lcdDrawTextIndented(y, STR_MODULE);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, BUTTON(TR_REGISTER), (menuHorizontalPosition == 0 ? attr : 0));
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_REGISTER, (menuHorizontalPosition == 0 ? attr : 0));
|
||||
lcdDrawText(lcdLastRightPos + 3, y, STR_MODULE_RANGE, (menuHorizontalPosition == 1 ? attr : 0));
|
||||
if (attr) {
|
||||
if (moduleState[moduleIdx].mode == MODULE_MODE_NORMAL && s_editMode > 0) {
|
||||
@@ -1946,7 +1946,7 @@ void menuModelSetup(event_t event)
|
||||
expandState.viewOpt = expandableSection(y, STR_ENABLED_FEATURES, expandState.viewOpt, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_RADIO_TAB:
|
||||
lcdDrawTextIndented(y, TR_RADIO_MENU_TABS);
|
||||
lcdDrawTextIndented(y, STR_RADIO_MENU_TABS);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_GF:
|
||||
g_model.radioGFDisabled = viewOptChoice(y, STR_MENUSPECIALFUNCS, g_model.radioGFDisabled, attr, event, g_eeGeneral.radioGFDisabled);
|
||||
@@ -1955,7 +1955,7 @@ void menuModelSetup(event_t event)
|
||||
g_model.radioTrainerDisabled = viewOptChoice(y, STR_MENUTRAINER, g_model.radioTrainerDisabled, attr, event, g_eeGeneral.radioTrainerDisabled);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_MODEL_TAB:
|
||||
lcdDrawTextIndented(y, TR_MODEL_MENU_TABS);
|
||||
lcdDrawTextIndented(y, STR_MODEL_MENU_TABS);
|
||||
break;
|
||||
#if defined(HELI)
|
||||
case ITEM_VIEW_OPTIONS_HELI:
|
||||
@@ -2008,14 +2008,14 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_USBJOYSTICK_CH_BUTTON:
|
||||
lcdDrawText(INDENT_WIDTH, y, BUTTON(TR_USBJOYSTICK_SETTINGS), attr);
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_USBJOYSTICK_SETTINGS, attr);
|
||||
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
pushMenu(menuModelUSBJoystick);
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_USBJOYSTICK_APPLY:
|
||||
lcdDrawText(INDENT_WIDTH, y, BUTTON(TR_USBJOYSTICK_APPLY_CHANGES), attr);
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_USBJOYSTICK_APPLY_CHANGES, attr);
|
||||
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
onUSBJoystickModelChanged();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void menuModelSensor(event_t event)
|
||||
{
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[s_currIdx];
|
||||
|
||||
drawStringWithIndex(PSIZE(TR_MENUSENSOR)*FW+FW, 0, STR_SENSOR, s_currIdx+1);
|
||||
drawStringWithIndex(strlen(STR_MENUSENSOR)*FW+FW, 0, STR_SENSOR, s_currIdx+1);
|
||||
drawSensorCustomValue(25*FW, 0, s_currIdx, getValue(MIXSRC_FIRST_TELEM+3*s_currIdx));
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
|
||||
@@ -741,7 +741,7 @@ void menuRadioSetup(event_t event)
|
||||
expandState.viewOpt = expandableSection(y, STR_ENABLED_FEATURES, expandState.viewOpt, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_RADIO_TAB:
|
||||
lcdDrawTextIndented(y, TR_RADIO_MENU_TABS);
|
||||
lcdDrawTextIndented(y, STR_RADIO_MENU_TABS);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_GF:
|
||||
g_eeGeneral.radioGFDisabled = viewOptCheckBox(y, STR_MENUSPECIALFUNCS, g_eeGeneral.radioGFDisabled, attr, event, g_model.radioGFDisabled);
|
||||
@@ -750,7 +750,7 @@ void menuRadioSetup(event_t event)
|
||||
g_eeGeneral.radioTrainerDisabled = viewOptCheckBox(y, STR_MENUTRAINER, g_eeGeneral.radioTrainerDisabled, attr, event, g_model.radioTrainerDisabled);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_MODEL_TAB:
|
||||
lcdDrawTextIndented(y, TR_MODEL_MENU_TABS);
|
||||
lcdDrawTextIndented(y, STR_MODEL_MENU_TABS);
|
||||
break;
|
||||
#if defined(HELI)
|
||||
case ITEM_VIEW_OPTIONS_HELI:
|
||||
|
||||
Reference in New Issue
Block a user