Bug 1121827 - Java Variables validator causes incorrect warnings on Seam/JSF variables
Summary: Java Variables validator causes incorrect warnings on Seam/JSF variables
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Zanata
Classification: Retired
Component: Component-UI
Version: 3.4
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Damian Jansen
QA Contact: Zanata-QA Mailling List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-22 02:51 UTC by Marcelo Barbosa "firemanxbr"
Modified: 2015-07-29 02:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-29 02:47:52 UTC


Attachments (Terms of Use)
bug_zanata (163.31 KB, image/png)
2014-07-22 02:51 UTC, Marcelo Barbosa "firemanxbr"
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 958645 None None None Never

Internal Links: 958645

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


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