Skip to content

Commit 3334b86

Browse files
committed
empty translations in ts file
and if empty in qm file take source value
1 parent 2c13e53 commit 3334b86

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/core/qgsproject.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -2834,5 +2834,11 @@ QString QgsProject::translate( const QString &context, const QString &sourceText
28342834
return sourceText;
28352835
}
28362836

2837-
return mTranslator->translate( context.toUtf8(), sourceText.toUtf8(), disambiguation, n );
2837+
QString result = mTranslator->translate( context.toUtf8(), sourceText.toUtf8(), disambiguation, n );
2838+
2839+
if ( result.isEmpty() )
2840+
{
2841+
return sourceText;
2842+
}
2843+
return result;
28382844
}

src/core/qgstranslationcontext.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ void QgsTranslationContext::writeTsFile( const QString &locale )
8181
messageElement.appendChild( sourceElement );
8282

8383
QDomElement translationElement = doc.createElement( QStringLiteral( "translation" ) );
84-
QDomText translationText = doc.createTextNode( translatableObject.source );
85-
translationElement.appendChild( translationText );
84+
translationElement.setAttribute( QStringLiteral( "type" ), QStringLiteral( "unfinished" ) );
8685
messageElement.appendChild( translationElement );
8786
}
8887

0 commit comments

Comments
 (0)