Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0050234Openbravo ERPE. Translationpublic2022-09-13 12:202023-10-31 16:18
shuehner 
aferraz 
normalmajorhave not tried
closedfixed 
5
 
PR24Q1 
Core
No
0050234: Export translation process creates many 'empty' xml files for tables not having a translation
When having a module with some translatable elements and then exporting this translation the process creates 1 xml file for each table even if there are 0 rows inside those files.

That produces lot of useless files and makes it hard to see what is the real content.

We should probably change the export to just skip creating the xml file in case there are no rows.
Install module:
https://gitlab.com/obcustomers/OBFR/org.openbravo.reporting.integration.retail.fr_FR [^]

Export translation for french language.
Check the created xml files in <attach.path>/lang/fr_FR/org.openbravo.reporting.integration.retail

Only 2 of 25 files have rows inside them:
grep -c '<row' *.xml | grep -v :0

AD_MESSAGE_TRL_fr_FR.xml:8
AD_REF_LIST_TRL_fr_FR.xml:1
No tags attached.
Issue History
2022-09-13 12:20shuehnerNew Issue
2022-09-13 12:20shuehnerAssigned To => Triage Platform Base
2022-09-13 12:20shuehnerModules => Core
2022-09-13 12:20shuehnerTriggers an Emergency Pack => No
2022-09-13 13:44hgbotNote Added: 0141053
2023-01-12 09:33AugustoMauchAssigned ToTriage Platform Base => meriem_azaf
2023-01-12 13:35AugustoMauchAssigned Tomeriem_azaf => aferraz
2023-10-31 16:18hgbotNote Added: 0156560
2023-10-31 16:18hgbotResolutionopen => fixed
2023-10-31 16:18hgbotStatusnew => closed
2023-10-31 16:18hgbotFixed in Version => PR24Q1
2023-10-31 16:18hgbotNote Added: 0156561

Notes
(0141053)
hgbot   
2022-09-13 13:44   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/710 [^]
(0156560)
hgbot   
2023-10-31 16:18   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/710 [^]
(0156561)
hgbot   
2023-10-31 16:18   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 5e4dc581ab768c87f2430179c605d2f36f0af128
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 31-10-2023 16:17:13
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/5e4dc581ab768c87f2430179c605d2f36f0af128 [^]

Fixes ISSUE-50234: Skip exporting translation xml files if empty

Skip creating the exported xml translation files entirely if they would
be empty (not having any rows).

Adjust the ReducedTranslactionExportTests to test the modified behavior
- Rename test expectedEmptyTranslationFiles to expectedEmptyTranslationFilesAbsent
  as now no 'empty (just 2 header lines) xml file is expected when there
  is no content but instead the xml file should be absent/missing
- Adjust testExistInFullAndNotExistsInReduced testcase (which checks that
  a specific text is absent) to allow for the reduced file to be missing
  - That way the test case can be used flexibly for checking the
    'reduced export' functionality without needing to know if the
    resulting xml file got empty/missing

---
M src-test/src/org/openbravo/test/reducedtranslation/ReducedTranslationExportTests.java
M src/org/openbravo/erpCommon/ad_forms/TranslationManager.java
---