From 5b6fac36c68816bf0d55bfcc9ab1cf47aca3c208 Mon Sep 17 00:00:00 2001 From: Cliff Date: Fri, 30 Sep 2022 21:29:16 -0400 Subject: [PATCH] fix(color): Move mdls not in models.yml to `/Models/Unused` (#2397) * Move models.yml that don't exist into /Models/Unused * Add sdMove, Translations, move both models.yml * Comments, break loop, rmv extra bool. * Show Press_Any_Key on dialog * Translations * Always create /Models/UNUSED if models.yml exists. * Close directories --- radio/src/sdcard.cpp | 37 ++++++ radio/src/sdcard.h | 3 + radio/src/storage/modelslist.cpp | 101 +++++++++++++--- radio/src/storage/yaml/CMakeLists.txt | 1 + radio/src/storage/yaml/yaml_modelslist.cpp | 127 +++++++++++++++++++++ radio/src/storage/yaml/yaml_modelslist.h | 33 ++++++ radio/src/translations.cpp | 1 + radio/src/translations.h | 3 +- radio/src/translations/cn.h | 7 +- radio/src/translations/cz.h | 1 + radio/src/translations/da.h | 9 +- radio/src/translations/de.h | 1 + radio/src/translations/en.h | 1 + radio/src/translations/es.h | 1 + radio/src/translations/fi.h | 9 +- radio/src/translations/fr.h | 1 + radio/src/translations/it.h | 1 + radio/src/translations/nl.h | 7 +- radio/src/translations/pl.h | 7 +- radio/src/translations/pt.h | 7 +- radio/src/translations/se.h | 9 +- 21 files changed, 327 insertions(+), 40 deletions(-) create mode 100644 radio/src/storage/yaml/yaml_modelslist.cpp create mode 100644 radio/src/storage/yaml/yaml_modelslist.h diff --git a/radio/src/sdcard.cpp b/radio/src/sdcard.cpp index e3ad2838e..4057e61c3 100644 --- a/radio/src/sdcard.cpp +++ b/radio/src/sdcard.cpp @@ -416,6 +416,43 @@ const char * sdCopyFile(const char * srcFilename, const char * srcDir, const cha return sdCopyFile(srcPath, destPath); } + +// Will overwrite if destination exists +const char * sdMoveFile(const char * srcPath, const char * destPath) +{ + const char *result; + result = sdCopyFile(srcPath, destPath); + if(result != 0) { + return result; + } + + FRESULT fres = f_unlink(srcPath); + if(fres != FR_OK) { + return SDCARD_ERROR(fres); + } + return nullptr; +} + +// Will overwrite if destination exists +const char * sdMoveFile(const char * srcFilename, const char * srcDir, const char * destFilename, const char * destDir) +{ + const char *result; + result = sdCopyFile(srcFilename, srcDir, destFilename, destDir); + if(result != 0) { + return result; + } + + char srcPath[2*CLIPBOARD_PATH_LEN+1]; + char * tmp = strAppend(srcPath, srcDir, CLIPBOARD_PATH_LEN); + *tmp++ = '/'; + strAppend(tmp, srcFilename, CLIPBOARD_PATH_LEN); + FRESULT fres = f_unlink(srcPath); + if(fres != FR_OK) { + return SDCARD_ERROR(fres); + } + return nullptr; +} + #endif // defined(SDCARD) diff --git a/radio/src/sdcard.h b/radio/src/sdcard.h index a58e2f498..ac7a8f19c 100644 --- a/radio/src/sdcard.h +++ b/radio/src/sdcard.h @@ -35,6 +35,7 @@ extern FIL g_oLogFile; #define ROOT_PATH PATH_SEPARATOR #define MODELS_PATH ROOT_PATH "MODELS" // no trailing slash = important #define DELETED_MODELS_PATH MODELS_PATH PATH_SEPARATOR "DELETED" +#define UNUSED_MODELS_PATH MODELS_PATH PATH_SEPARATOR "UNUSED" #define RADIO_PATH ROOT_PATH "RADIO" // no trailing slash = important #define TEMPLATES_PATH ROOT_PATH "TEMPLATES" #define PERS_TEMPL_PATH TEMPLATES_PATH "/PERSONAL" @@ -191,6 +192,8 @@ unsigned int findNextFileIndex(char * filename, uint8_t size, const char * direc const char * sdCopyFile(const char * src, const char * dest); const char * sdCopyFile(const char * srcFilename, const char * srcDir, const char * destFilename, const char * destDir); +const char * sdMoveFile(const char * src, const char * dest); +const char * sdMoveFile(const char * srcFilename, const char * srcDir, const char * destFilename, const char * destDir); #define LIST_NONE_SD_FILE 1 #define LIST_SD_FILE_EXT 2 diff --git a/radio/src/storage/modelslist.cpp b/radio/src/storage/modelslist.cpp index 36dccd99e..1de5c0d77 100644 --- a/radio/src/storage/modelslist.cpp +++ b/radio/src/storage/modelslist.cpp @@ -30,6 +30,7 @@ using std::list; #include "storage/sdcard_yaml.h" #include "yaml/yaml_datastructs.h" #include "yaml/yaml_labelslist.h" +#include "yaml/yaml_modelslist.h" #include "yaml/yaml_parser.h" #endif @@ -1024,6 +1025,84 @@ bool ModelsList::loadYaml() f_closedir(&moddir); } + // Check if models.yml exists + // Any files found above that are not listed in the file will be moved into + // /MDOELS/UNUSED and removed from the discovered file hash list + char line[LEN_MODELS_IDX_LINE + 1]; + FILINFO fno; + FRESULT result; + bool foundInModels = f_stat(MODELSLIST_YAML_PATH, &fno) == FR_OK; + bool foundInRadio = f_stat(FALLBACK_MODELSLIST_YAML_PATH, &fno) == FR_OK; + + if(foundInModels) { // Default to /Models copy + result = f_open(&file, MODELSLIST_YAML_PATH, FA_OPEN_EXISTING | FA_READ); + } else if (foundInRadio) { + result = f_open(&file, FALLBACK_MODELSLIST_YAML_PATH, FA_OPEN_EXISTING | FA_READ); + } + if((foundInModels || foundInRadio) && result == FR_OK) { + // Create /Models/Unused if it doesn't exist + bool moveRequired = false; + DIR unusedFolder; + FRESULT result = f_opendir(&unusedFolder, UNUSED_MODELS_PATH); + if (result != FR_OK) { + if (result == FR_NO_PATH) result = f_mkdir(UNUSED_MODELS_PATH); + if (result != FR_OK) { + TRACE("Unable to create unused models folder"); + return false; + } + } else f_closedir(&unusedFolder); + + YamlParser ymp; + std::vector modfiles; + void *ctx = get_modelslist_iter(&modfiles); + ymp.init(get_modelslist_parser_calls(), ctx); + UINT bytes_read = 0; + while (f_read(&file, line, sizeof(line), &bytes_read) == FR_OK) { + if (bytes_read == 0) break; + if (f_eof(&file)) ymp.set_eof(); + if (ymp.parse(line, bytes_read) != YamlParser::CONTINUE_PARSING) break; + } + f_close(&file); + + // Loop through file hases, move any files found that don't exists to /unused + std::vector newFileHash; + for(const auto &fhas: fileHashInfo) { + bool found = false; + for(const auto &file : modfiles) { + if (file == fhas.name) { + TRACE_LABELS("Found file %s in models.yml.. OK!", file); + found = true; + break; + } + } + if(!found) { + moveRequired = true; + TRACE_LABELS("Model %s not in models.yml, moving to /UNUSED", fhas.name.c_str()); + // Move model into unused folder. + const char *warning = sdMoveFile(fhas.name.c_str(), MODELS_PATH, fhas.name.c_str(), UNUSED_MODELS_PATH); + if(warning) + POPUP_WARNING(warning); + } else { + newFileHash.push_back(fhas); // File exists, keep it + } + } + + if(foundInRadio) { + const char *warning = sdMoveFile(MODELS_FILENAME, RADIO_PATH, MODELS_FILENAME, UNUSED_MODELS_PATH); + if(warning) + POPUP_WARNING(warning); + } + if(foundInModels) { // Will overwrite the copy from /radio if both existed, do last + const char *warning = sdMoveFile(MODELS_FILENAME, MODELS_PATH, MODELS_FILENAME, UNUSED_MODELS_PATH); + if(warning) + POPUP_WARNING(warning); + } + if(moveRequired) { + fileHashInfo = newFileHash; // Update the new file list + POPUP_WARNING(TR_MODELS_MOVED "\n" UNUSED_MODELS_PATH, "\n" TR_PRESS_ANY_KEY_TO_SKIP); + } + } + #if defined(DEBUG_TIMERS) DEBUG_TIMER_SAMPLE(debugTimerYamlScan); TRACE("Lables: Time to scan models folder %luus", @@ -1031,9 +1110,7 @@ bool ModelsList::loadYaml() #endif // Scan labels.yml - char line[LEN_MODELS_IDX_LINE + 1]; - FRESULT result = - f_open(&file, LABELSLIST_YAML_PATH, FA_OPEN_EXISTING | FA_READ); + result = f_open(&file, LABELSLIST_YAML_PATH, FA_OPEN_EXISTING | FA_READ); if (result == FR_OK) { YamlParser yp; void *ctx = get_labelslist_iter(); @@ -1340,21 +1417,15 @@ bool ModelsList::removeModel(ModelCell *model) TRACE("Unable to create deleted models folder"); return true; } - } + } else f_closedir(&deletedFolder); // Move model into deleted folder. If not moved will be re-added on next // reboot - if (!sdCopyFile(model->modelFilename, MODELS_PATH, model->modelFilename, - DELETED_MODELS_PATH)) { - char curFilename[sizeof(MODELS_PATH) + LEN_MODEL_FILENAME + 2] = ""; - strcat(curFilename, MODELS_PATH PATH_SEPARATOR); - strcat(curFilename, model->modelFilename); - TRACE_LABELS("Deleting Model %s", model->modelFilename); - - if (f_unlink(curFilename) != FR_OK) { - TRACE("Labels: Unable to delete file"); - return true; - } + TRACE_LABELS("Deleting Model %s", model->modelFilename); + const char *warning = sdMoveFile(model->modelFilename, MODELS_PATH, model->modelFilename, DELETED_MODELS_PATH); + if (warning) { + TRACE("Labels: Unable to move file"); + return true; } // Free memory diff --git a/radio/src/storage/yaml/CMakeLists.txt b/radio/src/storage/yaml/CMakeLists.txt index 964d07e97..eaf282576 100644 --- a/radio/src/storage/yaml/CMakeLists.txt +++ b/radio/src/storage/yaml/CMakeLists.txt @@ -7,6 +7,7 @@ set(SRC ${SRC} storage/yaml/yaml_tree_walker.cpp if(STORAGE_MODELSLIST) set(SRC ${SRC} storage/yaml/yaml_labelslist.cpp) + set(SRC ${SRC} storage/yaml/yaml_modelslist.cpp) add_definitions(-DSTORAGE_MODELSLIST) endif() diff --git a/radio/src/storage/yaml/yaml_modelslist.cpp b/radio/src/storage/yaml/yaml_modelslist.cpp new file mode 100644 index 000000000..29a782683 --- /dev/null +++ b/radio/src/storage/yaml/yaml_modelslist.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "yaml_modelslist.h" +#include "yaml_parser.h" + +#include "storage/modelslist.h" + +#include + +using std::list; + +struct modelslist_iter +{ + enum Level { + Root=0, + Category=1, + Model=2 + }; + + std::vector* filelist; + uint8_t level; + char current_attr[16]; // set after find_node() +}; + +static modelslist_iter __modelslist_iter_inst; + +void* get_modelslist_iter(std::vector* filelist) +{ + __modelslist_iter_inst.filelist = filelist; + __modelslist_iter_inst.level = 0; + + return &__modelslist_iter_inst; +} + +static bool to_parent(void* ctx) +{ + modelslist_iter* mi = (modelslist_iter*)ctx; + if (mi->level == modelslist_iter::Root) { + return false; + } + + mi->level--; + return true; +} + +static bool to_child(void* ctx) +{ + modelslist_iter* mi = (modelslist_iter*)ctx; + if (mi->level == modelslist_iter::Model) { + return false; + } + + mi->level++; + return true; +} + +static bool to_next_elmt(void* ctx) +{ + modelslist_iter* mi = (modelslist_iter*)ctx; + if (mi->level == modelslist_iter::Root) { + return false; + } + return true; +} + +static bool find_node(void* ctx, char* buf, uint8_t len) +{ + modelslist_iter* mi = (modelslist_iter*)ctx; + + if (len > sizeof(modelslist_iter::current_attr)-1) + len = sizeof(modelslist_iter::current_attr)-1; + + memcpy(mi->current_attr, buf, len); + mi->current_attr[len] = '\0'; + + return true; +} + +static void set_attr(void* ctx, char* buf, uint8_t len) +{ + char fnamebuf[LEN_MODEL_FILENAME + 1]; + modelslist_iter* mi = (modelslist_iter*)ctx; + + switch (mi->level) { + case modelslist_iter::Model: + if (!strcmp(mi->current_attr, "filename")) { + if(len <= LEN_MODEL_FILENAME) { + memcpy(fnamebuf, buf, len); + fnamebuf[len] = '\0'; + mi->filelist->push_back(fnamebuf); + } + } + break; + } +} + +static const YamlParserCalls modelslistCalls = { + to_parent, + to_child, + to_next_elmt, + find_node, + set_attr +}; + +const YamlParserCalls* get_modelslist_parser_calls() +{ + return &modelslistCalls; +} diff --git a/radio/src/storage/yaml/yaml_modelslist.h b/radio/src/storage/yaml/yaml_modelslist.h new file mode 100644 index 000000000..7614253eb --- /dev/null +++ b/radio/src/storage/yaml/yaml_modelslist.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) EdgeTX + * + * Based on code named + * opentx - https://github.com/opentx/opentx + * th9x - http://code.google.com/p/th9x + * er9x - http://code.google.com/p/er9x + * gruvin9x - http://code.google.com/p/gruvin9x + * + * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _YAML_MODELSLIST_H_ +#define _YAML_MODELSLIST_H_ + +#include +#include + +struct YamlParserCalls; + +void* get_modelslist_iter(std::vector* filelist); +const YamlParserCalls* get_modelslist_parser_calls(); + +#endif \ No newline at end of file diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 866e9c39d..787717a85 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -340,6 +340,7 @@ const char STR_MODELS[] = TR_MODELS; const char STR_SELECT_MODE[] = TR_SELECT_MODE; const char STR_CREATE_MODEL[] = TR_CREATE_MODEL; const char STR_FAVORITE_LABEL[] = TR_FAVORITE_LABEL; +const char STR_MODELS_MOVED[] = TR_MODELS_MOVED; const char STR_NEW_MODEL[] = TR_NEW_MODEL; const char STR_INVALID_MODEL[] = TR_INVALID_MODEL; const char STR_EDIT_LABELS[] = TR_EDIT_LABELS; diff --git a/radio/src/translations.h b/radio/src/translations.h index abcc57d85..964ba40b4 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -9,7 +9,7 @@ * * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html * - * This program is free software; you can redistribute it and/or modify + * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * @@ -539,6 +539,7 @@ extern const char STR_MODELS[]; extern const char STR_SELECT_MODE[]; extern const char STR_CREATE_MODEL[]; extern const char STR_FAVORITE_LABEL[]; +extern const char STR_MODELS_MOVED[]; extern const char STR_NEW_MODEL[]; extern const char STR_INVALID_MODEL[]; extern const char STR_EDIT_LABELS[]; diff --git a/radio/src/translations/cn.h b/radio/src/translations/cn.h index 64f437e70..5bb014f7a 100644 --- a/radio/src/translations/cn.h +++ b/radio/src/translations/cn.h @@ -633,6 +633,7 @@ #define TR_SELECT_MODE "选择模式" #define TR_CREATE_MODEL "创建模型" #define TR_FAVORITE_LABEL "Favorites" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "New Model" #define TR_INVALID_MODEL "Invalid Model" #define TR_EDIT_LABELS "Edit Labels" @@ -806,7 +807,7 @@ #define TR_PATH_TOO_LONG "路径太长" #define TR_VIEW_TEXT "查看文本" #define TR_FLASH_BOOTLOADER "更新引导程序" -#define TR_FLASH_DEVICE TR("更新设备","更新设备") +#define TR_FLASH_DEVICE TR("更新设备","更新设备") #define TR_FLASH_EXTERNAL_DEVICE TR("从S.Port更新", "从 S.Port 端口更新外设固件") #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" #define TR_FLASH_RECEIVER_BY_EXTERNAL_MODULE_OTA "Flash RX by ext. OTA" @@ -1309,9 +1310,9 @@ #define TR_ADD_ALL_TRIMS_TO_SUBTRIMS "将所有微调导入中点偏移值" #if LCD_W > LCD_H - #define TR_OPEN_CHANNEL_MONITORS "打开通道监视器" + #define TR_OPEN_CHANNEL_MONITORS "打开通道监视器" #else - #define TR_OPEN_CHANNEL_MONITORS "通道监视" + #define TR_OPEN_CHANNEL_MONITORS "通道监视" #endif #define TR_DUPLICATE "复制" #define TR_ACTIVATE "启用" diff --git a/radio/src/translations/cz.h b/radio/src/translations/cz.h index 7efbc720e..b1bfdbc5f 100644 --- a/radio/src/translations/cz.h +++ b/radio/src/translations/cz.h @@ -649,6 +649,7 @@ #define TR_SELECT_MODE "Vybrat mód" #define TR_CREATE_MODEL "Nový model" #define TR_FAVORITE_LABEL "Oblíbené" +#define TR_MODELS_MOVED "Nepoužívané modely přesunuty do" #define TR_NEW_MODEL "Nový model" #define TR_INVALID_MODEL "Neplatný model" #define TR_EDIT_LABELS "Upravit štítek" diff --git a/radio/src/translations/da.h b/radio/src/translations/da.h index d6142a184..e35fe7e29 100644 --- a/radio/src/translations/da.h +++ b/radio/src/translations/da.h @@ -29,7 +29,7 @@ * \001 to \034 -extended spacing (value * FW/2) * \0 -ends current string */ - + #define TR_OFFON "FRA","TIL" #define TR_MMMINV "---","INV" #define TR_VBEEPMODE "Stille","Alarm","NoKey","Alle" @@ -633,6 +633,7 @@ #define TR_SELECT_MODE "Vælg tilstand" #define TR_CREATE_MODEL "Opret model" #define TR_FAVORITE_LABEL "Favoritter" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "Ny model" #define TR_INVALID_MODEL "Ingen billede" #define TR_EDIT_LABELS "Ret type" @@ -806,7 +807,7 @@ #define TR_PATH_TOO_LONG "Sti for lang" #define TR_VIEW_TEXT "Vis tekst" #define TR_FLASH_BOOTLOADER "Brænde bootloader" -#define TR_FLASH_DEVICE TR("Brænde enhed","Brænde enhed") +#define TR_FLASH_DEVICE TR("Brænde enhed","Brænde enhed") #define TR_FLASH_EXTERNAL_DEVICE TR("Brænde S.Port", "Brænde S.Port enhed") #define TR_FLASH_RECEIVER_OTA "Brænde modtager OTA" #define TR_FLASH_RECEIVER_BY_EXTERNAL_MODULE_OTA "Brænde RX med ext. OTA" @@ -1309,9 +1310,9 @@ #define TR_ADD_ALL_TRIMS_TO_SUBTRIMS "Tillæg alle trim til subtrim" #if LCD_W > LCD_H - #define TR_OPEN_CHANNEL_MONITORS "Åbn kanal Monitor" + #define TR_OPEN_CHANNEL_MONITORS "Åbn kanal Monitor" #else - #define TR_OPEN_CHANNEL_MONITORS "Åbn kanal Mon." + #define TR_OPEN_CHANNEL_MONITORS "Åbn kanal Mon." #endif #define TR_DUPLICATE "Dupliker" #define TR_ACTIVATE "Set aktiv" diff --git a/radio/src/translations/de.h b/radio/src/translations/de.h index b20a83da5..1e54abff8 100644 --- a/radio/src/translations/de.h +++ b/radio/src/translations/de.h @@ -632,6 +632,7 @@ #define TR_SELECT_MODE "Wähle Mode" #define TR_CREATE_MODEL TR("Neues Modell" , "Neues Modell erstellen") #define TR_FAVORITE_LABEL "Favoriten" +#define TR_MODELS_MOVED "Unbenutzte Modelle werden verschoben nach" #define TR_NEW_MODEL "Neues Modell" #define TR_INVALID_MODEL "ungültiges Modell" #define TR_EDIT_LABELS "Label ändern" diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index adca52bb8..3fe75f47d 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -633,6 +633,7 @@ #define TR_SELECT_MODE "Select mode" #define TR_CREATE_MODEL "Create model" #define TR_FAVORITE_LABEL "Favorites" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "New Model" #define TR_INVALID_MODEL "Invalid Model" #define TR_EDIT_LABELS "Edit Labels" diff --git a/radio/src/translations/es.h b/radio/src/translations/es.h index 7c6631fa3..894c928e3 100644 --- a/radio/src/translations/es.h +++ b/radio/src/translations/es.h @@ -634,6 +634,7 @@ #define TR_SELECT_MODE "Select mode" #define TR_CREATE_MODEL "Crear modelo" #define TR_FAVORITE_LABEL "Favorites" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "New Model" #define TR_INVALID_MODEL "Invalid Model" #define TR_EDIT_LABELS "Edit Labels" diff --git a/radio/src/translations/fi.h b/radio/src/translations/fi.h index e895280a5..38ca7d714 100644 --- a/radio/src/translations/fi.h +++ b/radio/src/translations/fi.h @@ -179,7 +179,7 @@ #endif #define TR_VFSWRESET TR_FSW_RESET_TIMERS,"All",TR_FSW_RESET_TELEM - + #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define TR_TELEM_RESERVE TR("[--]","[---]") @@ -648,6 +648,7 @@ #define TR_SELECT_MODE "Select mode" #define TR_CREATE_MODEL "Create Model" #define TR_FAVORITE_LABEL "Favorites" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "New Model" #define TR_INVALID_MODEL "Invalid Model" #define TR_EDIT_LABELS "Edit Labels" @@ -820,7 +821,7 @@ #define TR_PATH_TOO_LONG "Polku liian pitkä" #define TR_VIEW_TEXT "View text" #define TR_FLASH_BOOTLOADER "Flash bootloader" -#define TR_FLASH_DEVICE TR("Flash device","Flash device") +#define TR_FLASH_DEVICE TR("Flash device","Flash device") #define TR_FLASH_EXTERNAL_DEVICE "Flash External Device" #define TR_FLASH_RECEIVER_OTA "Flash receiver OTA" #define TR_FLASH_RECEIVER_BY_EXTERNAL_MODULE_OTA "Flash RX by ext. OTA" @@ -1331,9 +1332,9 @@ #define TR_ADD_ALL_TRIMS_TO_SUBTRIMS "Add all Trims to Subtrims" #if LCD_W > LCD_H - #define TR_OPEN_CHANNEL_MONITORS "Open Channel Monitor" + #define TR_OPEN_CHANNEL_MONITORS "Open Channel Monitor" #else - #define TR_OPEN_CHANNEL_MONITORS "Open Channel Mon." + #define TR_OPEN_CHANNEL_MONITORS "Open Channel Mon." #endif #define TR_DUPLICATE "Duplicate" diff --git a/radio/src/translations/fr.h b/radio/src/translations/fr.h index 87e7d299e..aa3f61b6f 100644 --- a/radio/src/translations/fr.h +++ b/radio/src/translations/fr.h @@ -653,6 +653,7 @@ #define TR_SELECT_MODE "Select mode" #define TR_CREATE_MODEL "Créer modèle" #define TR_FAVORITE_LABEL "Favorites" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "New Model" #define TR_INVALID_MODEL "Invalid Model" #define TR_EDIT_LABELS "Edit Labels" diff --git a/radio/src/translations/it.h b/radio/src/translations/it.h index 6ac860c53..28b21c5c8 100644 --- a/radio/src/translations/it.h +++ b/radio/src/translations/it.h @@ -634,6 +634,7 @@ #define TR_SELECT_MODE "Seleziona modo" #define TR_CREATE_MODEL "Crea Modello" #define TR_FAVORITE_LABEL "Favoriti" +#define TR_MODELS_MOVED "Modelli inutilizzati spostati in" #define TR_NEW_MODEL "Nuovo Modello" #define TR_INVALID_MODEL "Modello invalido" #define TR_EDIT_LABELS "Edita Etichette" diff --git a/radio/src/translations/nl.h b/radio/src/translations/nl.h index 5f6374eac..e273dc82d 100644 --- a/radio/src/translations/nl.h +++ b/radio/src/translations/nl.h @@ -639,11 +639,12 @@ #define TR_SELECT_MODE "Select mode" #define TR_CREATE_MODEL "Nieuw Model" #define TR_FAVORITE_LABEL "Favorites" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "New Model" -#define TR_INVALID_MODEL "Invalid Model" +#define TR_INVALID_MODEL "Invalid Model" #define TR_EDIT_LABELS "Edit Labels" -#define TR_MOVE_UP "Move Up" -#define TR_MOVE_DOWN "Move Down" +#define TR_MOVE_UP "Move Up" +#define TR_MOVE_DOWN "Move Down" #define TR_ENTER_LABEL "Enter Label" #define TR_LABEL "Label" #define TR_LABELS "Labels" diff --git a/radio/src/translations/pl.h b/radio/src/translations/pl.h index fdd6d1de1..0655008e8 100644 --- a/radio/src/translations/pl.h +++ b/radio/src/translations/pl.h @@ -630,11 +630,12 @@ #define TR_SELECT_MODE "Select mode" #define TR_CREATE_MODEL "Nowy model" #define TR_FAVORITE_LABEL "Favorites" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "New Model" -#define TR_INVALID_MODEL "Invalid Model" +#define TR_INVALID_MODEL "Invalid Model" #define TR_EDIT_LABELS "Edit Labels" -#define TR_MOVE_UP "Move Up" -#define TR_MOVE_DOWN "Move Down" +#define TR_MOVE_UP "Move Up" +#define TR_MOVE_DOWN "Move Down" #define TR_ENTER_LABEL "Enter Label" #define TR_LABEL "Label" #define TR_LABELS "Labels" diff --git a/radio/src/translations/pt.h b/radio/src/translations/pt.h index b79429e43..2d4aa6a36 100644 --- a/radio/src/translations/pt.h +++ b/radio/src/translations/pt.h @@ -636,11 +636,12 @@ #define TR_SELECT_MODE "Select mode" #define TR_CREATE_MODEL "Criar Modelo" #define TR_FAVORITE_LABEL "Favorites" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "New Model" -#define TR_INVALID_MODEL "Invalid Model" +#define TR_INVALID_MODEL "Invalid Model" #define TR_EDIT_LABELS "Edit Labels" -#define TR_MOVE_UP "Move Up" -#define TR_MOVE_DOWN "Move Down" +#define TR_MOVE_UP "Move Up" +#define TR_MOVE_DOWN "Move Down" #define TR_ENTER_LABEL "Enter Label" #define TR_LABEL "Label" #define TR_LABELS "Labels" diff --git a/radio/src/translations/se.h b/radio/src/translations/se.h index ec22848d5..c2ca7d338 100644 --- a/radio/src/translations/se.h +++ b/radio/src/translations/se.h @@ -78,7 +78,7 @@ #else #define TR_RETA123 "R","H","G","S","1","2","3" #endif - + #define TR_VCURVEFUNC "---","x>0","x<0","|x|","f>0","f<0","|f|" #define TR_VMLTPX "Addera","Förstärk","Ersätt" #define TR_VMLTPX2 "+=","*=",":=" @@ -673,6 +673,7 @@ #define TR_SELECT_MODE "Välj läge" #define TR_CREATE_MODEL "Skapa modell" #define TR_FAVORITE_LABEL "Favoriter" +#define TR_MODELS_MOVED "Unused models moved to" #define TR_NEW_MODEL "Ny modell" #define TR_INVALID_MODEL "Ogiltig modell" #define TR_EDIT_LABELS "Redigera etiketter" @@ -981,7 +982,7 @@ #define TR_ENABLE "Aktivera" #define TR_TOPLCDTIMER "Översta LCD timer" #define TR_UNIT "Enhet" -#define TR_TELEMETRY_NEWSENSOR INDENT "Lägg till..." +#define TR_TELEMETRY_NEWSENSOR INDENT "Lägg till..." #define TR_CHANNELRANGE TR(INDENT "Kanalomr.", INDENT "Kanalområde") #define TR_RXFREQUENCY TR("RX frekv.", "RX frekvens") #define TR_AFHDS3_RX_FREQ TR("RX frekv", "RX frekvens") @@ -1373,9 +1374,9 @@ #define TR_ADD_ALL_TRIMS_TO_SUBTRIMS "Addera alla trimmar till subtrimmar" #if LCD_W > LCD_H - #define TR_OPEN_CHANNEL_MONITORS "Öppna kanalmonitorn" + #define TR_OPEN_CHANNEL_MONITORS "Öppna kanalmonitorn" #else - #define TR_OPEN_CHANNEL_MONITORS "Öppna kanalmon." + #define TR_OPEN_CHANNEL_MONITORS "Öppna kanalmon." #endif #define TR_DUPLICATE "Duplicera"