Browse Source

Allow report menu items to be translated

Neal Wilson 9 years ago
parent
commit
44489a1778
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/typica.w

+ 3
- 1
src/typica.w View File

13915
     QDomDocument document;
13915
     QDomDocument document;
13916
     document.setContent(&file, true);
13916
     document.setContent(&file, true);
13917
     QDomElement root = document.documentElement();
13917
     QDomElement root = document.documentElement();
13918
+    QString translationContext = root.attribute("id");
13918
     QDomNode titleNode = root.elementsByTagName("reporttitle").at(0);
13919
     QDomNode titleNode = root.elementsByTagName("reporttitle").at(0);
13919
     if(!titleNode.isNull())
13920
     if(!titleNode.isNull())
13920
     {
13921
     {
13921
         QDomElement titleElement = titleNode.toElement();
13922
         QDomElement titleElement = titleNode.toElement();
13922
-        QString title = titleElement.text();
13923
+        QString title = QCoreApplication::translate(translationContext.toAscii().data(),
13924
+                                                    titleElement.text().toUtf8().data());
13923
         if(!title.isEmpty())
13925
         if(!title.isEmpty())
13924
         {
13926
         {
13925
             QStringList hierarchy = title.split(":->");
13927
             QStringList hierarchy = title.split(":->");

Loading…
Cancel
Save