Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0044053Openbravo ERPE. Translationpublic2020-05-13 15:112020-10-19 16:21
AtulOpenbravo 
AtulOpenbravo 
normalmajoralways
closedfixed 
5
 
 
Core
No
0044053: Before transforming PO to XML, check whether new line exists at the end of PO File, if not add it
In Translation Helper, Export PO's process generates zip file which includes each module to be translated. PO files for each module table are structured such that each PO file ends with a new line.
When these PO files are being edited by PO Edit tool, it is found that new line at the end of PO file is lost.
For the Last candidates in such a PO files, When PO files are being transformed back to XML files in PO2XML, Original String is set as blank though there exists a Original String as well as Translated String for it.

eg could be found at

https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core.fr_FR/diff/a42eb9a0c723/referencedata/translation/fr_FR/OBUISEL_SELECTOR_TRL_fr_FR.xml [^]

@@ -1,22 +1,17 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <compiereTrl language="fr_FR" table="OBUISEL_SELECTOR" version="">
- <row id="34CC84D1AB714A978F6B79F2B434058A" trl="N">
- <value column="Name" original="Aba Layout Variant Selector"/>
- <value column="Description" original="Aba Layout Variant Selector"/>
+ <row id="34CC84D1AB714A978F6B79F2B434058A" trl="Y">
+ <value column="Name" original="Aba Layout Variant Selector">Sélecteur de variantes de disposition de la zone de boutons d'action</value>
+ <value column="Description" original=""/>


It is therefore necessary to check and if required add new line at end of each PO file before transforming them to XML files in the org.openbravo.xmlpo module
https://code.openbravo.com/erp/mods/org.openbravo.xmlpo [^]
-
No tags attached.
diff ProposedFixForBUG_44053.diff (2,356) 2020-05-13 15:16
https://issues.openbravo.com/file_download.php?file_id=14476&type=bug
Issue History
2020-05-13 15:11AtulOpenbravoNew Issue
2020-05-13 15:11AtulOpenbravoAssigned To => platform
2020-05-13 15:11AtulOpenbravoModules => Core
2020-05-13 15:11AtulOpenbravoTriggers an Emergency Pack => No
2020-05-13 15:16AtulOpenbravoProposed Solution updated
2020-05-13 15:16AtulOpenbravoFile Added: ProposedFixForBUG_44053.diff
2020-05-13 15:18AtulOpenbravoDescription Updatedbug_revision_view_page.php?rev_id=21012#r21012
2020-05-13 15:18AtulOpenbravoProposed Solution updated
2020-05-13 15:20AtulOpenbravoDescription Updatedbug_revision_view_page.php?rev_id=21013#r21013
2020-05-13 15:20AtulOpenbravoProposed Solution updated
2020-05-18 07:18alostaleAssigned Toplatform => Triage Finance
2020-10-13 08:45xabiermerinoResolution time => 1604098800
2020-10-19 10:44AtulOpenbravoStatusnew => scheduled
2020-10-19 10:44AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2020-10-19 13:56AtulOpenbravoNote Added: 0123767
2020-10-19 13:57AtulOpenbravoNote Edited: 0123767bug_revision_view_page.php?bugnote_id=0123767#r21802
2020-10-19 14:23hgbotNote Added: 0123768
2020-10-19 16:21hgbotResolutionopen => fixed
2020-10-19 16:21hgbotStatusscheduled => closed
2020-10-19 16:21hgbotNote Added: 0123775
2020-10-19 16:21hgbotNote Added: 0123776
2020-10-19 16:21hgbotNote Added: 0123777

Notes
(0123767)
AtulOpenbravo   
2020-10-19 13:56   
(edited on: 2020-10-19 13:57)
Test Plan
- Install org.openbravo.xmlpo and org.openbravo.translator.helper modules and their dependent modules in instance.
- Login as System Admin
- Navigate to Translation Helper window
- Choose any language and run Export PO's process.
- Realize that po zip is downloaded.
- Extract the contents of the zip and open up any po file in PO Editor tool and close the file.
- Again the zip the po extracted folder with same directory structure.
- Using Translation Helper window, select the previously selected language, run Import PO's process, select the zip file (whose contents were opened/edited in PO editor tool)
- Execute the process. Realize that it is successful.


To check the effect of patch
- Run the above process twice one with fix and one without fix.
- Remember to take backup of XML files in both the case from attachments/lang/ directory
- Check the difference between both the XML

Before change when AD_ELEMENT_Name_es_ES.po and AD_MENU_Name_es_ES.po files opened/edited in PO Editor Tool is as below:-

--- a/AD_ELEMENT_TRL_es_ES.xml Mon Oct 19 17:11:43 2020 +0530
+++ b/AD_ELEMENT_TRL_es_ES.xml Mon Oct 19 17:13:34 2020 +0530
@@ -27791,7 +27791,7 @@
     <value column="PO_PrintName" original=""/>
   </row>
   <row id="FF80818131FFA2FC0131FFC874C5001D" trl="N">
- <value column="Name" original="Run Time"/>
+ <value column="Name" original=""/>
     <value column="PrintName" original="Run Time"/>
     <value column="Description" original="Operation run time"/>
     <value column="Help" original="Operation run time"/>
diff -r 0a069fa706ef AD_MENU_TRL_es_ES.xml
--- a/AD_MENU_TRL_es_ES.xml Mon Oct 19 17:11:43 2020 +0530
+++ b/AD_MENU_TRL_es_ES.xml Mon Oct 19 17:13:34 2020 +0530
@@ -1600,8 +1600,8 @@
     <value column="Name" original="Return from Customer"/>
     <value column="Description" original=""/>
   </row>
- <row id="FF808181323E504701323E5E20F10063" trl="Y">
- <value column="Name" original="Production Run">Ejecución de producción</value>
+ <row id="FF808181323E504701323E5E20F10063" trl="N">
+ <value column="Name" original=""/>
     <value column="Description" original="Edit precisely what has been produced from a selected product order."/>
   </row>
 </compiereTrl>


After the change there is no such change found in the above files.

(0123768)
hgbot   
2020-10-19 14:23   
Merge Request created: https://gitlab.com/openbravo/tools/translations/org.openbravo.xmlpo/-/merge_requests/4 [^]
(0123775)
hgbot   
2020-10-19 16:21   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/tools/translations/org.openbravo.xmlpo [^]
Changeset: e1c9632f18bd9ac94de3496dbc0cfe64661a91e1
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2020-10-19T17:51:58+05:30
URL: https://gitlab.com/openbravo/tools/translations/org.openbravo.xmlpo/-/commit/e1c9632f18bd9ac94de3496dbc0cfe64661a91e1 [^]

Fixes BUG-0044053: Before transforming PO to XML, check
whether new line exists at the end of PO File, if not add
it

When transforming PO files to XML file check whether PO file
ends with a new line or not, if not then append a new line
at end of file and use the file for transformation.

---
M src/org/openbravo/xmlpo/po2xml/PO2XMLMain.java
---
(0123776)
hgbot   
2020-10-19 16:21   
Repository: https://gitlab.com/openbravo/tools/translations/org.openbravo.xmlpo [^]
Changeset: a1fd56db3112d42a73435d0be52f8211db5af060
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2020-10-19T18:03:14+05:30
URL: https://gitlab.com/openbravo/tools/translations/org.openbravo.xmlpo/-/commit/a1fd56db3112d42a73435d0be52f8211db5af060 [^]

Related To BUG-44053:Before transforming PO to XML, check
whether new line exists at the end of PO File, if not add
it

Uncommented the call to checkAddNewLineAtEOF method that was
left commented during testing.

---
M src/org/openbravo/xmlpo/po2xml/PO2XMLMain.java
---
(0123777)
hgbot   
2020-10-19 16:21   
Merge request merged: https://gitlab.com/openbravo/tools/translations/org.openbravo.xmlpo/-/merge_requests/4 [^]