Bug 882729 - False validation warnings for variables in format '%{pool}'
False validation warnings for variables in format '%{pool}'
Status: CLOSED NOTABUG
Product: Zanata
Classification: Community
Component: Component-UI (Show other bugs)
2.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Runa Bhattacharjee
Ding-Yi Chen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-02 18:50 EST by Hedda Peters
Modified: 2013-03-03 21:22 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 882760 882761 (view as bug list)
Environment:
Last Closed: 2012-12-02 20:23:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
False validation warnings (127.07 KB, image/png)
2012-12-02 18:50 EST, Hedda Peters
no flags Details

  None (edit)
Description Hedda Peters 2012-12-02 18:50:34 EST
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
Comment 1 Hedda Peters 2012-12-02 19: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.
Comment 2 Sean Flanigan 2012-12-02 20: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.

Note You need to log in before you can comment on or make changes to this bug.