Skip to content
Permalink
Browse files

empty translations in ts file

and if empty in qm file take source value
  • Loading branch information
signedav committed Aug 22, 2018
1 parent 2c13e53 commit 3334b86e221589ee2231837b79c6523156b504d1
Showing with 8 additions and 3 deletions.
  1. +7 −1 src/core/qgsproject.cpp
  2. +1 −2 src/core/qgstranslationcontext.cpp
@@ -2834,5 +2834,11 @@ QString QgsProject::translate( const QString &context, const QString &sourceText
return sourceText;
}

return mTranslator->translate( context.toUtf8(), sourceText.toUtf8(), disambiguation, n );
QString result = mTranslator->translate( context.toUtf8(), sourceText.toUtf8(), disambiguation, n );

if ( result.isEmpty() )
{
return sourceText;
}
return result;
}
@@ -81,8 +81,7 @@ void QgsTranslationContext::writeTsFile( const QString &locale )
messageElement.appendChild( sourceElement );

QDomElement translationElement = doc.createElement( QStringLiteral( "translation" ) );
QDomText translationText = doc.createTextNode( translatableObject.source );
translationElement.appendChild( translationText );
translationElement.setAttribute( QStringLiteral( "type" ), QStringLiteral( "unfinished" ) );
messageElement.appendChild( translationElement );
}

0 comments on commit 3334b86

Please sign in to comment.
You can’t perform that action at this time.