mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
Translation has been fixed
This commit is contained in:
parent
a56cfdc4d7
commit
7566cfd886
@ -908,6 +908,7 @@ bool ReportEnginePrivate::isNeedToSave()
|
||||
QString ReportEnginePrivate::renderToString()
|
||||
{
|
||||
LimeReport::ReportRender render;
|
||||
updateTranslations();
|
||||
dataManager()->connectAllDatabases();
|
||||
dataManager()->setDesignTime(false);
|
||||
if (m_pages.count()){
|
||||
@ -1120,6 +1121,7 @@ ReportPages ReportEnginePrivate::renderToPages()
|
||||
{
|
||||
if (m_reportRendering) return ReportPages();
|
||||
m_reportRender = ReportRender::Ptr(new ReportRender);
|
||||
updateTranslations();
|
||||
|
||||
dataManager()->clearErrors();
|
||||
dataManager()->connectAllDatabases();
|
||||
@ -1160,7 +1162,6 @@ ReportPages ReportEnginePrivate::renderToPages()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int i=0; i<m_renderingPages.count(); ++i){
|
||||
PageItemDesignIntf* page = m_renderingPages.at(i);
|
||||
if (page->isTOC()){
|
||||
|
@ -82,8 +82,14 @@ void ReportTranslation::updatePageTranslation(PageDesignIntf* page)
|
||||
if (itemTranslation){
|
||||
foreach(QString propertyName, stringsForTranslation.keys()){
|
||||
PropertyTranslation* propertyTranslation = itemTranslation->findProperty(propertyName);
|
||||
if (propertyTranslation->checked)
|
||||
propertyTranslation->sourceHasBeenChanged = propertyTranslation->sourceValue != stringsForTranslation.value(propertyName);
|
||||
if (propertyTranslation->sourceHasBeenChanged)
|
||||
propertyTranslation->checked = false;
|
||||
propertyTranslation->sourceValue = stringsForTranslation.value(propertyName);
|
||||
propertyTranslation->sourceHasBeenChanged = propertyTranslation->value != propertyTranslation->sourceValue;
|
||||
|
||||
if ( language() == QLocale::AnyLanguage )
|
||||
propertyTranslation->value = propertyTranslation->sourceValue;
|
||||
}
|
||||
} else {
|
||||
createItemTranslation(item, pageTranslation);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 1.9 KiB |
@ -19,7 +19,7 @@ TranslationEditor::TranslationEditor(QWidget *parent) :
|
||||
ui->splitter_2->setStretchFactor(1,2);
|
||||
ui->splitter->setStretchFactor(0,2);
|
||||
QTableWidgetItem* item = new QTableWidgetItem();
|
||||
item->setIcon(QIcon(":/translationeditor/images/checked.png"));
|
||||
item->setIcon(QIcon(":/translationeditor/checked"));
|
||||
ui->tbStrings->setColumnCount(4);
|
||||
ui->tbStrings->setColumnWidth(0,30);
|
||||
ui->tbStrings->setColumnWidth(1,100);
|
||||
@ -132,8 +132,14 @@ void TranslationEditor::activatePage(PageTranslation* pageTranslation)
|
||||
ui->tbStrings->setRowCount(rowIndex+1);
|
||||
foreach(PropertyTranslation* propertyTranslation, itemTranslation->propertyesTranslation){
|
||||
QTableWidgetItem* checkItem = new QTableWidgetItem();
|
||||
if (propertyTranslation->checked)
|
||||
checkItem->setIcon(QIcon(":/translationeditor/images/checked.png"));
|
||||
|
||||
if (propertyTranslation->sourceHasBeenChanged){
|
||||
checkItem->setIcon(QIcon(":/translationeditor/question"));
|
||||
}
|
||||
if (propertyTranslation->checked){
|
||||
checkItem->setIcon(QIcon(":/translationeditor/checked"));
|
||||
}
|
||||
|
||||
ui->tbStrings->setItem(rowIndex,0,checkItem);
|
||||
ui->tbStrings->setItem(rowIndex,1,new QTableWidgetItem(itemTranslation->itemName));
|
||||
ui->tbStrings->setItem(rowIndex,2,new QTableWidgetItem(propertyTranslation->propertyName));
|
||||
@ -179,7 +185,7 @@ void TranslationEditor::on_cbChecked_toggled(bool checked)
|
||||
{
|
||||
if (m_currentPropertyTranslation){
|
||||
m_currentPropertyTranslation->checked = checked;
|
||||
ui->tbStrings->item(ui->tbStrings->currentRow(),0)->setIcon(checked ? QIcon(":/translationeditor/images/checked.png"):QIcon());
|
||||
ui->tbStrings->item(ui->tbStrings->currentRow(),0)->setIcon(checked ? QIcon(":/translationeditor/checked"):QIcon());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
<RCC>
|
||||
<qresource prefix="/translationeditor">
|
||||
<file>images/add.png</file>
|
||||
<file>images/remove.png</file>
|
||||
<file alias="add">images/add.png</file>
|
||||
<file alias="remove">images/remove.png</file>
|
||||
<file>images/checked.png</file>
|
||||
<file>images/question.png</file>
|
||||
<file alias="question">images/question.png</file>
|
||||
<file alias="checked">images/green_check.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -62,7 +62,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="translationeditor.qrc">
|
||||
<normaloff>:/translationeditor/images/add.png</normaloff>:/translationeditor/images/add.png</iconset>
|
||||
<normaloff>:/translationeditor/add</normaloff>:/translationeditor/add</iconset>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
@ -76,7 +76,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="translationeditor.qrc">
|
||||
<normaloff>:/translationeditor/images/remove.png</normaloff>:/translationeditor/images/remove.png</iconset>
|
||||
<normaloff>:/translationeditor/remove</normaloff>:/translationeditor/remove</iconset>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
@ -158,6 +158,10 @@
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="translationeditor.qrc">
|
||||
<normaloff>:/translationeditor/checked</normaloff>:/translationeditor/checked</iconset>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
@ -215,6 +219,7 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="translationeditor.qrc"/>
|
||||
<include location="translationeditor.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
Loading…
Reference in New Issue
Block a user