Skip to content

Commit

Permalink
Fix translation of mapped text strings. Thanks to Nicolas Riendeau fo…
Browse files Browse the repository at this point in the history
…r pointing it out.
  • Loading branch information
stuartm authored and daniel-kristjansson committed Apr 5, 2012
1 parent 549a3c8 commit 2cd7bf9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mythtv/libs/libmythui/mythuitext.cpp
Expand Up @@ -157,9 +157,15 @@ void MythUIText::SetTextFromMap(QHash<QString, QString> &map)
if (!newText.isEmpty() && newText.contains(regexp))
{
int pos = 0;
QString tempString = newText;

while ((pos = regexp.indexIn(newText, pos)) != -1)
QString translatedTemplate = qApp->translate("ThemeUI",
newText.toUtf8(),
NULL,
QCoreApplication::UnicodeUTF8);

QString tempString = translatedTemplate;

while ((pos = regexp.indexIn(translatedTemplate, pos)) != -1)
{
QString key = regexp.cap(4).toLower().trimmed();
QString replacement;
Expand Down

0 comments on commit 2cd7bf9

Please sign in to comment.