diff --git a/conf/okular.kcfg b/conf/okular.kcfg index ac82028c7..8bfddb75e 100644 --- a/conf/okular.kcfg +++ b/conf/okular.kcfg @@ -255,6 +255,17 @@ QDomElement toolElement = toolDescription.toElement(); if ( toolElement.tagName() == "tool" ) { + // Translate strings + toolElement.setAttribute( "name", i18n( toolElement.attribute("name").toUtf8() ) ); + QDomNode tooltip = toolElement.elementsByTagName( "tooltip" ).item( 0 ); + if ( tooltip.isElement() ) + { + QDomElement trTooltip = doc.createElement( "tooltip" ); + QString trTooltipStr = i18nc( "Annotation tool", tooltip.toElement().text().toUtf8() ); + trTooltip.appendChild( doc.createTextNode( trTooltipStr ) ); + toolElement.replaceChild( tooltip, trTooltip ); + } + QDomDocument temp; temp.appendChild( temp.importNode( toolElement, true) ); // add each <tool>...</tool> as XML string diff --git a/conf/settings.kcfgc b/conf/settings.kcfgc index 9f2109ff2..ef7b5f261 100644 --- a/conf/settings.kcfgc +++ b/conf/settings.kcfgc @@ -6,5 +6,5 @@ Mutators=true Singleton=true Visibility=OKULAR_EXPORT IncludeFiles=core/okular_export.h, settings_core.h -SourceIncludeFiles=kstandarddirs.h,qdom.h +SourceIncludeFiles=klocalizedstring.h,kstandarddirs.h,qdom.h MemberVariables=dpointer diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp index f53931243..977fd78d0 100644 --- a/ui/pageviewannotator.cpp +++ b/ui/pageviewannotator.cpp @@ -645,7 +645,7 @@ void PageViewAnnotator::reparseConfig() { AnnotationToolItem item; item.id = toolElement.attribute("id").toInt(); - item.text = i18n( toolElement.attribute( "name" ).toUtf8() ); + item.text = toolElement.attribute( "name" ); item.pixmap = toolElement.attribute("pixmap"); QDomNode shortcutNode = toolElement.elementsByTagName( "shortcut" ).item( 0 ); if ( shortcutNode.isElement() ) @@ -962,7 +962,7 @@ void PageViewAnnotator::slotToolSelected( int toolID ) { const QString tip = toolSubElement.text(); if ( !tip.isEmpty() ) - m_pageView->displayMessage( i18nc( "Annotation tool", tip.toUtf8() ), QString(), PageViewMessage::Annotation ); + m_pageView->displayMessage( tip, QString(), PageViewMessage::Annotation ); } }