mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
imagewriter: Use QCoreApplication::translate
tr() is not safe for strings that you move between contexts, as it fails to provide a mechanism for specifying the context of the string. Regenerate the translation files, and use QCoreApplication to locate the real translations. Additionally, bodge a race condition between translator replacement and OS list fetching, by marking the OS list as something to be re-calculated on a translator change. Fixes #799
This commit is contained in:
parent
1c9c641924
commit
38ea837ba7
18 changed files with 2272 additions and 2198 deletions
|
@ -608,15 +608,15 @@ QByteArray ImageWriter::getFilteredOSlist() {
|
|||
}
|
||||
|
||||
reference_os_list_array.append(QJsonObject({
|
||||
{"name", tr("Erase")},
|
||||
{"description", tr("Format card as FAT32")},
|
||||
{"name", QApplication::translate("main", "Erase")},
|
||||
{"description", QApplication::translate("main", "Format card as FAT32")},
|
||||
{"icon", "icons/erase.png"},
|
||||
{"url", "internal://format"},
|
||||
}));
|
||||
|
||||
reference_os_list_array.append(QJsonObject({
|
||||
{"name", tr("Use custom")},
|
||||
{"description", tr("Select a custom .img from your computer")},
|
||||
{"name", QApplication::translate("main", "Use custom")},
|
||||
{"description", QApplication::translate("main", "Select a custom .img from your computer")},
|
||||
{"icon", "icons/use_custom.png"},
|
||||
{"url", ""},
|
||||
}));
|
||||
|
@ -1377,6 +1377,9 @@ void ImageWriter::replaceTranslator(QTranslator *trans)
|
|||
{
|
||||
_engine->retranslate();
|
||||
}
|
||||
|
||||
// Regenerate the OS list, because it has some localised items
|
||||
emit osListPrepared();
|
||||
}
|
||||
|
||||
QString ImageWriter::detectPiKeyboard()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue