Bug 802577

Summary: RFE: Java style variable validations in translation editor
Product: [Retired] Zanata Reporter: David Mason <damason>
Component: Component-UIAssignee: David Mason <damason>
Status: CLOSED CURRENTRELEASE QA Contact: Joyce Chang <jochang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.6-SNAPSHOTCC: petersen, sflaniga, zanata-bugs
Target Milestone: ---   
Target Release: 1.6-alpha-1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.6-SNAPSHOT (20120329-1642). Doc Type: Bug Fix
Doc Text:
Cause Zanata does not detect inconsistencies in Java-style variables between source strings and translated strings. Consequence Translators may inadvertently enter translations that are not valid, causing compilation or runtime errors in localised builds of Java software projects. Change Added a validator to the web editor that checks for Java style variables in the source and translated strings. Java style variables use an index number and may have a format specifier. The validator checks that: - all index numbers that are present in source are present in target - all index numbers that are present in target are present in source - each index number is present the same number of times in the source and target. The validator does not yet perform any validation of format specifiers. Result A validation error is displayed near the string currently being edited if the validator is active and any of the above conditions are not met.
Story Points: 3
Clone Of: Environment:
Last Closed: 2012-06-22 00:58:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Mason 2012-03-13 00:10:58 UTC
Description of problem:
Add validator for matching Java style (e.g. "{0}") variables.

Comment 1 David Mason 2012-03-15 03:02:46 UTC
Current implementation checks that all indices that are present in source are present in target, all indices present in target are present in source, and that each index is accessed the same number of times in the source and target.

This should cover the majority of strings. Yet to add checks that the same format specifiers are used between source and target.

Comment 2 Joyce Chang 2012-04-03 04:43:28 UTC
verified in Zanata version 1.6-SNAPSHOT (20120329-1642).

Comment 3 David Mason 2012-06-06 03:17:24 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
Zanata does not detect inconsistencies in Java-style variables between source strings and translated strings.

Consequence
Translators may inadvertently enter translations that are not valid, causing compilation or runtime errors in localised builds of Java software projects.

Change
Added a validator to the web editor that checks for Java style variables in the source and translated strings.

Java style variables use an index number and may have a format specifier. The validator checks that:
 - all index numbers that are present in source are present in target
 - all index numbers that are present in target are present in source
 - each index number is present the same number of times in the source and target.

The validator does not yet perform any validation of format specifiers.


Result
A validation error is displayed near the string currently being edited if the validator is active and any of the above conditions are not met.