UI: Remove spaces from translation keys

Qt translation strings use the full English string as an identifier,
rather than a standardised key. Meanwhile, .ini files aren't designed
for keys with spaces, so a translation string for "Restore Defaults"
won't match unless the ini line is
"Restore Defaults"="Defaults"
which is inconsistent, unpleasant and harder to read.
master
Matt Gajownik 2022-07-31 16:22:10 +10:00 committed by Jim
parent 3ae1c1470f
commit c7da23bf96
1 changed files with 3 additions and 1 deletions

View File

@ -1721,7 +1721,9 @@ QString OBSTranslator::translate(const char *context, const char *sourceText,
const char *disambiguation, int n) const
{
const char *out = nullptr;
if (!App()->TranslateString(sourceText, &out))
QString str(sourceText);
str.replace(" ", "");
if (!App()->TranslateString(QT_TO_UTF8(str), &out))
return QString(sourceText);
UNUSED_PARAMETER(context);