Bug 882729 - False validation warnings for variables in format '%{pool}'
Summary: False validation warnings for variables in format '%{pool}'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Zanata
Classification: Retired
Component: Component-UI
Version: 2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Runa Bhattacharjee
QA Contact: Ding-Yi Chen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-02 23:50 UTC by Hedda Peters
Modified: 2013-03-04 02:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 882760 882761 (view as bug list)
Environment:
Last Closed: 2012-12-03 01:23:06 UTC
Embargoed:


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

Description Hedda Peters 2012-12-02 23:50:34 UTC
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-03 00:32:21 UTC
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-03 01:23:06 UTC
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.