+++ This bug was initially created as a clone of Bug #882729 +++ Created attachment 656308 [details] False validation warnings Description of problem: Variables in the format '%{pool}' seem to trip up the validation check, which issues false warnings. Steps to Reproduce: 1. See https://translate.zanata.org/zanata/webtrans/translate?project=cfse&iteration=sam-1.2&localeId=de-DE&locale=de#view:doc;doc:app 2. Row 331 --- Additional comment from Hedda Peters on 2012-12-03 10:32:21 EST --- Additional information: In other entries similar variables don't seem to cause this problem, see row 578 of the same project - no validation warnings there with similar variables. Side note: Going back a few pages to look at row 331 again, I noticed that the editor shows "Validation Warnings: None", until I click into that entry. As soon as that entry has focus, the message changes to "Validation Warnings: 1". It would make more sense to have any validation warnings displayed accurately regardless of whether or not that particular entry is focussed. The message "Validation warning: None" is otherwise misleading. --- Additional comment from Sean Flanigan on 2012-12-03 11:23:06 EST --- These strings are actually not Java MessageFormat variables, they just look similar. You can tell by the '%' before the '{'. You need to disable Java variable validation while working on this document. (We plan to let project maintainers do this as a persistent setting in the DB.) We probably should have an RFE for validating this sort of variable (Python? Ruby?). Anyway, this is happening because of quoting. The English string contains "couldn't", and the apostrophe in "couldn't" is starting a quoted section. Java MessageFormat doesn't look for variables inside the quoted section, so the validation doesn't either. And Hedda's side note shows why showing the validations at all times is non-trivial to implement properly (until we store validation policies/results in the DB). At the very least, the message shouldn't say "Validation Warnings:" until it has run the validations for that row. ============================================ Ruby validator need to deal with 3 cases: 1. C-like conversion specifiers, such as %d, %x 2. String interpolation, such as #{variable} 3. str % arg for ruby >=1.9, such as %{arg} http://ruby-doc.org/core-1.9.3/String.html
Not enough demand for this feature at this stage. We may look into ways to validation better way such as plug-in approach in the future.