Description of problem: When pushing the properties files with a source string longer than 255, following error message is shown in server.log: resId length must be between 0 and 255 Version-Release number of selected component (if applicable): Zanata version 1.4.6-SNAPSHOT (20120127-0944). How reproducible: Always. Steps to Reproduce: 0. Assume project 'JBossAS', version 'master' is create in zanata. 1. git clone git://github.com/jbossas/jboss-as.gi 2. cd jboss 3. mvn zanata:push -Dzanata.enableModules=true 4. Document that trigger the error: https://github.com/jbossas/jboss-as/blob/master/jdr/jboss-as-sos/src/main/resources/sos/po/ru.properties Actual results: Following error message is shown in server.log: resId length must be between 0 and 255 Expected results: Sucessfully push without error. Additional info:
Is this still a problem? Thanks.
This will still occur. The issue is that Zanata's database currently only stores up to 255 characters for the id of each text flow, and for properties format the key is used directly without modification (unlike gettext, for which a hash of the content is used). The above link appears not to be valid. Looking at the updated version at https://github.com/jbossas/jboss-as/blob/master/jdr/jboss-as-sos/src/main/resources/sos/po/sos_ru.properties it appears that the key causing the problem is: This\ utility\ will\ collect\ some\ detailed\ \ information\ about\ the\nhardware\ and\ setup\ of\ your\ %(distroa)s\ system.\nThe\ information\ is\ collected\ and\ an\ archive\ is\ \ packaged\ under\n/tmp,\ which\ you\ can\ send\ to\ a\ support\ representative.\n%(distrob)s\ will\ use\ this\ information\ for\ diagnostic\ purposes\ ONLY\nand\ it\ will\ be\ considered\ confidential\ information.\n\nThis\ process\ may\ take\ a\ while\ to\ complete.\nNo\ changes\ will\ be\ made\ to\ your\ system.\n\n These appear to be extracted from python scripts, so in this specific case they would probably be better off using gettext. Looking at the API documentation for java properties, there does not appear to be any limit to the acceptable length of a key, so this is a bug in Zanata's properties support that we may want to address at some point.
should modify error message to something like "Zanata does not support properties key exceeding 255 characters"
Implemented checking of id length for properties. Zanata-common 1.8.6-SNAPSHOT Zanata-client 2.0.2-SNAPSHOT See https://github.com/zanata/zanata-client/commit/380b098a77a8e2d16cfbe6eadfeba601b36608e7 https://github.com/zanata/zanata-common/commit/f65c7fb212e486f59532e0eef07fa664dfd0a29a
This is a quick workaround for the time being, but should we investigate how to remove this restriction from property files?
The new address of the error-triggering document is now https://github.com/jbossas/jboss-as/blob/7.1/jdr/jboss-as-sos/src/main/resources/sos/po/sos_ru.properties The file is no longer in master.
Update exception thrown to runtime exception. https://github.com/zanata/zanata-common/commit/d91bcb1b4e3806c71a5ff3edc95f7df7670d8d48 https://github.com/zanata/zanata-client/commit/9ab89084848b6cfca9f95810ba083fa96d91446b
(In reply to comment #5) > This is a quick workaround for the time being, but should we investigate how > to remove this restriction from property files? I'm not sure if it's really worth supporting property keys of arbitrary length. Property keys files in Java projects don't normally get anywhere near that long; sos seems to be an aberration. I think it's reasonable for Zanata to have this limitation on key length. If it became a real problem, the client could always implement a second mapping for properties files in Zanata. For instance, we could hash the propertyKey+sourceText and call that the resId - similar to the mapping for PO files.