Openbravo Issue Tracking System - Tools
View Issue Details
0007009Toolsopenbravo2popublic2009-01-19 17:402020-04-13 09:22
gforcada 
alostale 
normalmajorhave not tried
closedout of date 
5
0007009: [openbravo2po-valuetrl]Old <value> lines shouldn't be keeped if the template doesn't have them (when running a runTemplateMerge
Updating an xml file with old <value> lines that aren't used in the template file used to update it should not been keeped.

The <value> lines with original="" aren't useful at all.

<row id="800109" trl="N">
 <value column="Name" isTrl="N" original="click Link">click Link</value>
 <value column="Arghelp1" isTrl="N" original="Introduzca el texto del link">Introduzca el texto del link</value>
 <value column="Arghelp2" isTrl="N" original="">click Link</value>
 <value column="Arghelp3" isTrl="N" original="">click Link</value>
 <value column="Description" isTrl="N" original="">click Link</value>
</row>

Instead it should look like:

<row id="800109" trl="N">
 <value column="Name" isTrl="N" original="click Link">click Link</value>
 <value column="Arghelp1" isTrl="N" original="Introduzca el texto del link">Introduzca el texto del link</value>
</row>

commsup_sprint6, translation
bz2 old value lines.tar.bz2 (560) 2009-01-23 09:59
https://issues.openbravo.com/file_download.php?file_id=708&type=bug
Issue History
2009-01-19 17:40gforcadaNew Issue
2009-01-23 09:59gforcadaFile Added: old value lines.tar.bz2
2009-01-23 10:11gforcadaNote Added: 0012552
2009-01-23 16:37jordimasIssue Monitored: jordimas
2009-01-27 12:04pheenanAssigned To => pheenan
2009-01-27 12:04pheenanStatusnew => scheduled
2009-01-27 12:04pheenanfix_in_branch => trunk
2009-01-27 12:26pheenanTag Attached: comsup_sprint5
2009-02-11 10:03pheenanTag Detached: comsup_sprint5
2009-02-11 10:04pheenanTag Attached: commsup_sprint6
2009-02-11 10:04pheenanTag Detached: commsup_sprint6
2009-02-11 10:05pheenanTag Attached: commsup_sprint6
2009-02-11 15:54pheenanNote Added: 0013354
2009-02-11 16:41svnbotCheckin
2009-02-11 16:41svnbotNote Added: 0013356
2009-02-11 16:41svnbotStatusscheduled => resolved
2009-02-11 16:41svnbotResolutionopen => fixed
2009-02-11 16:41svnbotsvn_revision => 269
2009-02-20 12:56gforcadaStatusresolved => new
2009-02-20 12:56gforcadaResolutionfixed => open
2009-02-20 12:56gforcadaNote Added: 0013832
2009-02-20 13:00gforcadaNote Added: 0013833
2009-04-30 12:21alostaleAssigned Topheenan => alostale
2009-04-30 18:16rmorleyTag Attached: translation
2020-04-13 09:22alostaleStatusnew => closed
2020-04-13 09:22alostaleResolutionopen => out of date

Notes
(0012552)
gforcada   
2009-01-23 10:11   
In the attached file you can see an en_US.xml file, used as template, an it_IT.xml file used as a base and a output/*_it_IT.xml file that is the result of merging en_US.xml and it_IT.xml file.

The command used was:

ant runTemplateMerge -DoutFold=../files/old\ value\ lines/output -DinpTempFile=../files/old\ value\ lines/AT_COMMAND_TRL_en_US.xml -DinpBaseFile=../files/old\ value\ lines/AT_COMMAND_TRL_it_IT.xml


The main problem with keeping them is that the translation is filled with the <value column="Name"> translation and when exported to po (with runXML2PO) they are added to po files and thus add false translations.
(0013354)
pheenan   
2009-02-11 15:54   
Fixed this issue with the following test information

Template File:
<?xml version="1.0" encoding="UTF-8"?>
<compiereTrl language="es_ES" table="AD_MENU" version="2.40">
  <row id="102" trl="Y">
    <value column="Name" original=""></value>
  </row>
  <row id="103" trl="Y">
    <value column="Name" original="Red"></value>
  </row>
  <row id="104" trl="Y">
    <value column="Name" original=""></value>
  </row>
  <row id="105" trl="Y">
    <value column="Name" original="Black"></value>
    <value column="Description" original="black reference"></value>
  </row>
  <row id="107" trl="Y">
    <value column="Name" original="Orange"></value>
  </row>
</compiereTrl>

Base File:
<?xml version="1.0" encoding="UTF-8"?>
<compiereTrl language="es_ES" table="AD_MENU" version="2.40">
  <row id="102" trl="Y">
    <value column="Name" original="Blue">Azul</value>
  </row>
  <row id="104" trl="Y">
    <value column="Name" original="">Verde</value>
  </row>
  <row id="105" trl="Y">
    <value column="Name" original="black">Negre</value>
    <value column="Description" original="black reference">Referencia de Negre</value>
  </row>
  <row id="106" trl="Y">
    <value column="Name" original="Yellow">Amarillo</value>
  </row>
  <row id="107" trl="Y">
    <value column="Name" original="Orange"></value>
  </row>
</compiereTrl>

Output File:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<compiereTrl language="es_ES" table="AD_MENU" version="2.40">
  <row id="103" trl="N">
    <value column="Name" isTrl="N" original="Red"/>
  </row>
  <row id="105" trl="Y">
    <value column="Name" isTrl="Y" original="Black">Negre</value>
    <value column="Description" isTrl="Y" original="black reference">Referencia de Negre</value>
  </row>
  <row id="107" trl="N">
    <value column="Name" isTrl="N" original="Orange"/>
  </row>
</compiereTrl>
(0013356)
svnbot   
2009-02-11 16:41   
Repository: localization
Revision: 269
Author: pheenan
Date: 2009-02-11 16:41:30 +0100 (Wed, 11 Feb 2009)

Fixed 7009. Updating functionality to clean value rows where there is no value in the original text. Also fixing issue in the valueType mapping (not indexing the values correctly.). Cleaned up some commented code that is no longer needed. Added test files to support the TestMergeXMLFiles test case. NOTE: need to add file comparison to the merge test.

---
U tools/openbravo2po/branches/openbravo2po-valuetrl/src/org/openbravo/xmlpo/objects/FileObject.java
U tools/openbravo2po/branches/openbravo2po-valuetrl/src/org/openbravo/xmlpo/objects/TaskProcess.java
U tools/openbravo2po/branches/openbravo2po-valuetrl/src/org/openbravo/xmlpo/templateMerge/TemplateProcessor.java
U tools/openbravo2po/branches/openbravo2po-valuetrl/src/org/openbravo/xmlpo/utils/MergeXMLFiles.java
U tools/openbravo2po/branches/openbravo2po-valuetrl/src/org/openbravo/xmlpo/utils/XMLFileBuilder.java
A tools/openbravo2po/branches/openbravo2po-valuetrl/tests/resources/templateMerge/base/AD_MENU_TRL_es_ES_MergeTest.xml
A tools/openbravo2po/branches/openbravo2po-valuetrl/tests/resources/templateMerge/output/AD_MENU_TRL_es_ES_Result.xml
A tools/openbravo2po/branches/openbravo2po-valuetrl/tests/resources/templateMerge/template/AD_MENU_TRL_MergeTest_Template.xml
U tools/openbravo2po/branches/openbravo2po-valuetrl/tests/src/org/openbravo/xmlpo/templateMerge/TestTemplateMerge.java
A tools/openbravo2po/branches/openbravo2po-valuetrl/tests/src/org/openbravo/xmlpo/utils/TestMergeXMLFiles.java
---

https://dev.openbravo.com/websvn/localization/?rev=269&sc=1 [^]
(0013832)
gforcada   
2009-02-20 12:56   
Hi Phil,

Seems something went wrong during this update.

In the previous version (rev 259) running a runTemplateMerge and then a runXML2PO worked fine for all Italian translations files that are now in the subversion.

From revision 269 (the one that fixes this bug) onwards the runXML2PO still works but if you do a runTemplateMerge and with the resulting file do a runXML2PO it fails with a java.lang.ArrayIndexOutOfBoundsException in XML2POMain
(0013833)
gforcada   
2009-02-20 13:00   
Files that actually fail:

it_IT/trunk/AT_COMMAND_TRL_it_IT.xml
it_IT/trunk/AD_WINDOW_TRL_it_IT.xml
it_IT/trunk/AD_TAB_TRL_it_IT.xml
it_IT/trunk/AD_REFERENCE_TRL_it_IT.xml
it_IT/trunk/AD_PROCESS_TRL_it_IT.xml
it_IT/trunk/AD_PROCESS_PARA_TRL_it_IT.xml
it_IT/trunk/AD_FIELD_TRL_it_IT.xml
it_IT/trunk/AD_ELEMENT_TRL_it_IT.xml

All of them show a java.lang.ArrayIndexOutOfBoundsException while running XML2POMain