Translation has been fixed

This commit is contained in:
Arin Alexander 2018-09-01 23:21:52 +03:00
parent 4b38f75a9c
commit ea2a38758d
2 changed files with 3 additions and 4 deletions

View File

@ -46,7 +46,7 @@
//#include <QJSEngine> //#include <QJSEngine>
#include <QQmlEngine> #include <QQmlEngine>
#else #else
#include <QScriptEngine> #include <QtScript/QScriptEngine>
#endif #endif
namespace LimeReport { namespace LimeReport {

View File

@ -82,14 +82,13 @@ void ReportTranslation::updatePageTranslation(PageDesignIntf* page)
if (itemTranslation){ if (itemTranslation){
foreach(QString propertyName, stringsForTranslation.keys()){ foreach(QString propertyName, stringsForTranslation.keys()){
PropertyTranslation* propertyTranslation = itemTranslation->findProperty(propertyName); PropertyTranslation* propertyTranslation = itemTranslation->findProperty(propertyName);
bool translated = propertyTranslation->sourceValue != propertyTranslation->value;
if (propertyTranslation->checked) if (propertyTranslation->checked)
propertyTranslation->sourceHasBeenChanged = propertyTranslation->sourceValue != stringsForTranslation.value(propertyName); propertyTranslation->sourceHasBeenChanged = propertyTranslation->sourceValue != stringsForTranslation.value(propertyName);
if (propertyTranslation->sourceHasBeenChanged) if (propertyTranslation->sourceHasBeenChanged)
propertyTranslation->checked = false; propertyTranslation->checked = false;
propertyTranslation->sourceValue = stringsForTranslation.value(propertyName); propertyTranslation->sourceValue = stringsForTranslation.value(propertyName);
if (!translated) propertyTranslation->value = propertyTranslation->sourceValue;
if ( language() == QLocale::AnyLanguage )
propertyTranslation->value = propertyTranslation->sourceValue;
} }
} else { } else {
createItemTranslation(item, pageTranslation); createItemTranslation(item, pageTranslation);