Simplify dynamic string handling and localization

Use Qt `.arg()` instead of substring replacement;
Fully remove remnants of SDL renderers from translations;
Restore platform-dependent pcap library name in the pcap
error message, but use Npcap on Windows instead
This commit is contained in:
Alexander Babikov
2024-03-20 18:52:51 +05:00
parent 82e6a7a129
commit f02fd4568c
26 changed files with 386 additions and 738 deletions

View File

@@ -40,12 +40,6 @@ public:
sourceText = "Begin trace\tCtrl+T";
if (strcmp(sourceText, "End trace") == 0)
sourceText = "End trace\tCtrl+T";
if (strcmp(sourceText, "&Qt (Software)") == 0) {
QString finalstr = QTranslator::translate("", "&SDL (Software)", disambiguation, n);
finalstr.replace("SDL", "Qt");
finalstr.replace("(&S)", "(&Q)");
return finalstr;
}
QString finalstr = QTranslator::translate("", sourceText, disambiguation, n);
#ifdef Q_OS_MACOS
if (finalstr.contains('\t'))