From 0906bdc6d7e39a76ab3498dbf4f24514297d0bdb Mon Sep 17 00:00:00 2001 From: Max Paperno Date: Tue, 30 May 2017 12:36:04 -0400 Subject: [PATCH] Adjust logical switch abbreviations. (#4965) * [Companion] Change logical switch abbreviations to "LS##" in Source/Switch selection lists. * [LogicalSwitchesPanel] Normalize LS name label. * We had decided on "Lxx" * Match firmware side * ARM wasn't using the translations * Update strhelpers.cpp --- companion/src/eeprominterface.cpp | 4 ++-- companion/src/modeledit/logicalswitches.cpp | 2 +- radio/src/strhelpers.cpp | 3 ++- radio/src/translations/cz.h.txt | 4 ++-- radio/src/translations/de.h.txt | 4 ++-- radio/src/translations/en.h.txt | 4 ++-- radio/src/translations/es.h.txt | 4 ++-- radio/src/translations/fi.h.txt | 4 ++-- radio/src/translations/fr.h.txt | 4 ++-- radio/src/translations/it.h.txt | 4 ++-- radio/src/translations/nl.h.txt | 4 ++-- radio/src/translations/pl.h.txt | 4 ++-- radio/src/translations/pt.h.txt | 4 ++-- radio/src/translations/se.h.txt | 4 ++-- 14 files changed, 27 insertions(+), 26 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index ee85809b6..a46f7445d 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -544,7 +544,7 @@ QString RawSource::toString(const ModelData * model, const GeneralSettings * con return result; case SOURCE_TYPE_CUSTOM_SWITCH: - return QObject::tr("LSw%1").arg(index+1, 2, 10, QChar('0')); + return RawSwitch(SWITCH_TYPE_VIRTUAL, index+1).toString(); case SOURCE_TYPE_CYC: return QObject::tr("CYC%1").arg(index+1); @@ -682,7 +682,7 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen } case SWITCH_TYPE_VIRTUAL: - return QObject::tr("LSw%1").arg(index, 2, 10, QChar('0')); + return QObject::tr("L%1").arg(index, 2, 10, QChar('0')); case SWITCH_TYPE_MULTIPOS_POT: if (!getCurrentFirmware()->getCapability(MultiposPotsPositions)) diff --git a/companion/src/modeledit/logicalswitches.cpp b/companion/src/modeledit/logicalswitches.cpp index 60b535549..fcdc53acd 100644 --- a/companion/src/modeledit/logicalswitches.cpp +++ b/companion/src/modeledit/logicalswitches.cpp @@ -48,7 +48,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, // The label QLabel * label = new QLabel(this); label->setProperty("index", i); - label->setText(tr("L%1").arg(i+1)); + label->setText(RawSwitch(SWITCH_TYPE_VIRTUAL, i+1).toString()); label->setContextMenuPolicy(Qt::CustomContextMenu); label->setMouseTracking(true); label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); diff --git a/radio/src/strhelpers.cpp b/radio/src/strhelpers.cpp index f2d7319c8..39558ff73 100644 --- a/radio/src/strhelpers.cpp +++ b/radio/src/strhelpers.cpp @@ -294,7 +294,8 @@ char * getSwitchString(char * dest, swsrc_t idx) #endif else if (idx <= SWSRC_LAST_LOGICAL_SWITCH) { - strAppendStringWithIndex(s, "L", idx-SWSRC_FIRST_LOGICAL_SWITCH+1); + *s++ = 'L'; + strAppendUnsigned(s, idx-SWSRC_FIRST_LOGICAL_SWITCH+1, 2); } else if (idx <= SWSRC_ONE) { getStringAtIndex(s, STR_VSWITCHES, IDX_ON_IN_STR_VSWITCHES + idx - SWSRC_ON); diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index d31a80589..9f7eccdbe 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -481,9 +481,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index 6a3fff20e..3f71815f0 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -504,9 +504,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index c27b27067..fbee0dc25 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -487,9 +487,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index eb46d0dd7..8aa130101 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -477,9 +477,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index f0e38f95f..1a4a41c3d 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -481,9 +481,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 0355d2980..17fa5c4ef 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -494,9 +494,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 7c84ab49d..596e26560 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -488,9 +488,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index 433746795..738487f66 100644 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -478,9 +478,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index b26da31b0..76efcec0c 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -490,9 +490,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 87a363d5f..892b99665 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -478,9 +478,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS) diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index aa94942a8..6c2034a81 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -495,9 +495,9 @@ #endif #if defined(CPUARM) - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12""L13""L14""L15""L16""L17""L18""L19""L20""L21""L22""L23""L24""L25""L26""L27""L28""L29""L30""L31""L32" #else - #define TR_LOGICALSW "L1\0""L2\0""L3\0""L4\0""L5\0""L6\0""L7\0""L8\0""L9\0""L10""L11""L12" + #define TR_LOGICALSW "L01""L02""L03""L04""L05""L06""L07""L08""L09""L10""L11""L12" #endif #if defined(PCBHORUS)