Bug 1121827

Summary: Java Variables validator causes incorrect warnings on Seam/JSF variables
Product: [Retired] Zanata Reporter: Marcelo Barbosa "firemanxbr" <marcelo.barbosa>
Component: Component-UIAssignee: Damian Jansen <djansen>
Status: CLOSED UPSTREAM QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.4CC: damason, dchen, zanata-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-29 02:47:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
bug_zanata none

Description Marcelo Barbosa "firemanxbr" 2014-07-22 02:51:55 UTC
Created attachment 919787 [details]
bug_zanata

Description of problem:
Showing wrong warning in translation interface

Version-Release number of selected component (if applicable):
Zanata 3.4.2 (git-server-3.4.2-dirty)

URL: https://translate.zanata.org/zanata/webtrans/translate?project=zanata-server&iteration=master&localeId=pt-BR&locale=en#view:doc;doc:zanata-war/src/main/resources/messages;untranslated:show;fuzzy:show;rejected:show


Actual results:
Warning: 1, Errors: 0
Unexpected variable: {messages['jsf.CopyTrans']}

Expected results:
No warning!

Additional info:

attached screenshot.

Comment 1 David Mason 2014-07-22 03:22:43 UTC
This is caused because the java variables validator is not appropriate for the type of variables used in these strings.

The warning in this case is caused because of an apostrophe (') in the source string before the variable, where there is no apostrophe in the translation.

In this case the source string is "Help: Set this project's default #{messages['jsf.CopyTrans'} settings.", and the apostrophe in "project's" makes the validator see the rest of the string as escaped, so it does not identify the variable "#{messages['jsf.CopyTrans'}"


Since we do not have a specific validator for these variables, the workaround at the moment is to save translations despite the warning, and never set Java Variables validator above warning for projects that are not using Java MessageFormat strings.

The solution is to create a validator that handles JSF/Seam variables properly.

Comment 2 Zanata Migrator 2015-07-29 02:47:52 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-199