[zanata-users] Push failled if two files have same message entries inside !!

Sean Flanigan sflaniga at redhat.com
Thu Jul 5 02:13:53 UTC 2012


That error means two textflows in the same document had the same ID.
Are you sure the id bd8ff7a0da15f60bb574e0ccb537cbf9 (or
"action.remove") only appears once in each document?


On 2012-07-04 18:06, Gregoire Henry wrote:
> Hi Sean , 
> 
> Sorry , i've re read my request and see some little confusion...
> 
> The duplicates keys are in different files , we have several files for a
> project.
> 
> It's a java project with .properties, i'm using Translate Toolkit
> prop2po to convert properties files to po files as this is more easy for
> translation. 
> 
> Actually we send thoses files to translators and recommend to use poEdit
> for avoiding encoding problems .
> 
> 
> Here is the detailled log 
> 
> [INFO] pushing source doc [name=dashboard-std size=132] to server
> .[INFO] >> REST Request: PUT =>
> http://vm-traduction.lswe.priv/zanata/rest/projects/p/Test-project/iterations/i/1.0/r/dashboard-std?copyTrans=true&ext=gettext&ext=comment
> <http://vm-traduction.lswe.priv/zanata/rest/projects/p/Test-project/iterations/i/1.0/r/dashboard-std?copyTrans=true&ext=gettext&ext=comment>
> [INFO] >> Header: X-Version-No = [1.6.0-alpha-2]
> [INFO] >> Header: X-Auth-User = [ghenry]
> [INFO] >> Header: X-Auth-Token = [********************************]
> [INFO] >> Header: Accept = [application/xml]
> [INFO] >> Body: <ns2:resource type="FILE" xml:lang="fr"
> content-type="application/x-gettext"
> xmlns:ns2="http://zanata.org/namespace/api/"
> xmlns:ns3="http://zanata.org/namespace/api/gettext/">
>     <name>dashboard-std</name>
>     <extensions>
>         <extension xsi:type="ns3:poHeaderExtension"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>             <comment></comment>
>             <entries>
>                 <entry key="Project-Id-Version">PACKAGE VERSION</entry>
>                 <entry key="Report-Msgid-Bugs-To"></entry>
>                 <entry key="POT-Creation-Date">2012-07-02 17:11+0200</entry>
>                 <entry key="MIME-Version">1.0</entry>
>                 <entry key="Content-Type">text/plain; charset=UTF-8</entry>
>                 <entry key="Content-Transfer-Encoding">8bit</entry>
>             </entries>
>         </extension>
>     </extensions>
> 
> {... some TextFlow entries ...}
> 
>         <ns2:text-flow xml:lang="fr" id="bd8ff7a0da15f60bb574e0ccb537cbf9">
>             <content>Supprimer</content>
>             <plural>false</plural>
>             <extensions>
>                 <extension xsi:type="ns3:potEntryHeader"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>                     <context>action.remove</context>
>                     <flags/>
>                     <source-references>
>                         <sourcereference>action.remove</sourcereference>
>                     </source-references>
>                 </extension>
>                 <extension xsi:type="ns5:simpleCommentExtension"
> xml:space="preserve"
> xmlns:ns5="http://zanata.org/namespace/api/comment/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>                     <value></value>
>                 </extension>
>             </extensions>
>         </ns2:text-flow>
> 
> {... some TextFlow entries ...}
> 
> [INFO] pushing source doc [name=dashboardMessages size=800] to server
> .[INFO] >> REST Request: PUT =>
> http://vm-traduction.lswe.priv/zanata/rest/projects/p/Test-project/iterations/i/1.0/r/dashboardMessages?copyTrans=true&ext=gettext&ext=comment
> <http://vm-traduction.lswe.priv/zanata/rest/projects/p/Test-project/iterations/i/1.0/r/dashboardMessages?copyTrans=true&ext=gettext&ext=comment>
> [INFO] >> Header: X-Version-No = [1.6.0-alpha-2]
> [INFO] >> Header: X-Auth-User = [ghenry]
> [INFO] >> Header: X-Auth-Token = [********************************]
> [INFO] >> Header: Accept = [application/xml]
> [INFO] >> Body: <ns2:resource type="FILE" xml:lang="fr"
> content-type="application/x-gettext"
> xmlns:ns2="http://zanata.org/namespace/api/"
> xmlns:ns3="http://zanata.org/namespace/api/gettext/">
>     <name>dashboardMessages</name>
>     <extensions>
>         <extension xsi:type="ns3:poHeaderExtension"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>             <comment></comment>
>             <entries>
>                 <entry key="Project-Id-Version">PACKAGE VERSION</entry>
>                 <entry key="Report-Msgid-Bugs-To"></entry>
>                 <entry key="POT-Creation-Date">2012-07-02 17:11+0200</entry>
>                 <entry key="MIME-Version">1.0</entry>
>                 <entry key="Content-Type">text/plain; charset=UTF-8</entry>
>                 <entry key="Content-Transfer-Encoding">8bit</entry>
>             </entries>
>         </extension>
>     </extensions>
> 
> {... some TextFlow entries ...}
> 
>         <ns2:text-flow xml:lang="fr" id="bd8ff7a0da15f60bb574e0ccb537cbf9">
>             <content>Supprimer</content>
>             <plural>false</plural>
>             <extensions>
>                 <extension xsi:type="ns3:potEntryHeader"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>                     <context>action.remove</context>
>                     <flags/>
>                     <source-references>
>                         <sourcereference>action.remove</sourcereference>
>                     </source-references>
>                 </extension>
>                 <extension xsi:type="ns5:simpleCommentExtension"
> xml:space="preserve"
> xmlns:ns5="http://zanata.org/namespace/api/comment/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>                     <value></value>
>                 </extension>
>             </extensions>
>         </ns2:text-flow>
> 
> {... some TextFlow entries ...}
> 
> Failed to execute goal
> org.zanata:zanata-maven-plugin:1.6.1-SNAPSHOT:push (default-cli) on
> project test: Zanata mojo exception: operation returned 400 (Bad
> Request): encountered TextFlow with duplicate ID
> bd8ff7a0da15f60bb574e0ccb537cbf9, uri:
> http://vm-traduction.lswe.priv/zanata/rest/projects/p/Test-project/iterations/i/1.0/r,
> annotations: [@javax.ws.rs.PUT(), @javax.ws.rs.Path(value={id})] -> [Help 1]
> 
> As you can see ,  the TextFlow ID is duplicated but between two
> different files , does the ID calculation take care about the file name ?
> 
> 
> 
> 
> 
> 2012/7/4 Sean Flanigan <sflaniga at redhat.com <mailto:sflaniga at redhat.com>>
> 
>     On 2012-07-04 00:21, Gregoire Henry wrote:
>     > Hello
>     >
>     > using
>     > server 1.6.1 (20120701-2315) (jdk 1.6.31, windows 2008,Mysql)
>     > maven client : 1.6.1-SNAPSHOT
>     >
>     > I'm trying to push some sources files (.pot) to the server , some of
>     > this files have similar entries (same key for messages) , and the push
>     > failled with a duplicate id .
>     >
>     > Doe's it mean that we can't have files with same message key ? or is
>     > this a bug ?
>     >
>     >
>     > Thank's for your answers
>     >
>     > Greg
>     >
> 
>     The Gettext format doesn't support multiple entries in the same file
>     which have the same msgid, unless they have different values for
>     msgctxt.  Do the gettext tools like msgcat, msgfmt complain about this
>     file too?
> 
> 
> 
>     --
>     Sean Flanigan
> 
>     Senior Software Engineer
>     Engineering - Internationalisation
>     Red Hat
> 
> 


-- 
Sean Flanigan

Senior Software Engineer
Engineering - Internationalisation
Red Hat

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/zanata-users/attachments/20120705/5b965bc3/attachment.sig>


More information about the zanata-users mailing list