Bug 867421
Summary: | [fr_FR] [localization] French: double apostrophe is displayed where a single apostrophe should be displayed | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Einav Cohen <ecohen> | ||||||
Component: | ovirt-engine-webadmin-portal | Assignee: | Vojtech Szocs <vszocs> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | |||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | unspecified | CC: | aalam, croe, dyasny, ecohen, iheim, lijli, qe-i18n-bugs, Rhev-m-bugs, sgrinber, vszocs, ykaul | ||||||
Target Milestone: | --- | Keywords: | Translation | ||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | ux | ||||||||
Fixed In Version: | si23 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2012-12-04 20:07:49 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
Einav Cohen
2012-10-17 13:30:43 UTC
Created attachment 628812 [details]
Screen-Shot of New VM dialog in French locale
screen shot is taken from oVirt - behavior is the same in rhev-m si21.
may be related: http://code.google.com/p/google-web-toolkit/issues/detail?id=6647 http://stackoverflow.com/questions/6537716/how-to-handle-single-quotes-in-internationalization-constants additional clarifications: - if some of the strings (within the .properties files) will be changed to contain a single apostrophe, a gwt compilation failure will occur (see http://stackoverflow.com/questions/6537716/how-to-handle-single-quotes-in-internationalization-constants) - there are some strings (within the .properties files) that contain double apostrophe, however the text is eventally displayed in the GUI appropriately (i.e. only with a single apostrophe). Of course, some of the strings are displayed eventually with double apostrophe (this is what this bug is about) - not sure why for some strings it is OK and for others it isn't; according to this: http://code.google.com/p/google-web-toolkit/issues/detail?id=6647 - the issue is Constants vs. Messages. Einav, many thanks for posting related references. Apparently, translator system in use (Zanata) adheres to Java MessageFormat specification: http://docs.oracle.com/javase/6/docs/api/java/text/MessageFormat.html Java MessageFormat treats double quotes ('') as single quote. Java MessageFormat documentation says: > Within a String, "''" represents a single quote. In GWT, there are two different types of localization resources (key/value mappings): 1. Constants - values are constants (no arguments), *does not* adhere to Java MessageFormat specification 2. Messages - values can contain arguments, *does* adhere to Java MessageFormat specification WebAdmin and UserPortal use *both* types of localization resources. Possible solutions: 1. (less feasible IMHO) translators will use single quotes in Constants-related properties files 2. (more feasible IMHO) replace Constants with Messages for both applications, given that properties file names will stay unchanged Oh well, the situation is a bit more complicated since we're also using Constants sub-interface ConstantsWithLookup, which provides the ability to retrieve values by keys programatically (instead of referencing values through keys directly in code). And there's no "MessagesWithLookup" in GWT, unfortunately. Two approaches possible: 1. modify Constants-related properties files [replace '' -> '], instruct translator team to use single quotes in Constants-related properties files, write checkstyle build-time checker that warns if double quotes is used in given Constants-related properties file 2. Extend GWT Constants/ConstantsWithLookup deferred binding generator, which takes care of replacing '' -> ' behind the scenes (no application code adapter classes necessary) For now, we can replace '' -> ' in all Constants-related properties files. In future, we should allow translator team to use single quotes in all properties files. This includes Messages-related properties files, which adhere to Java MessageFormat specification. In frontend/webadmin/modules/gwt-extension, we can add an aspect (class annotated with @Aspect) that replaces ' -> '' for Messages-related values: a, in com.google.gwt.i18n.rebind.MessageFormatParser class: public static List<TemplateChunk> parse(String template) throws ParseException b, in com.google.gwt.i18n.server.MessageFormatUtils.MessageStyle.MESSAGE_FORMAT enum: public List<TemplateChunk> parse(String template) throws ParseException The above two are the only places from which "Unterminated single quote" exception can originate. The aspect would modify "template" parameter, doing ' -> '' replacement. u/s patch: http://gerrit.ovirt.org/#/c/8730/ (In reply to comment #6) > In future, we should allow translator team to use single quotes in all > properties files. This includes Messages-related properties files, which > adhere to Java MessageFormat specification. opened bug 869329 to track this issue. *** Bug 869845 has been marked as a duplicate of this bug. *** Created attachment 643168 [details]
FIXED Screenshot
tested version: rhevm-3.1.0-26.el6ev.noarch
Language: fr_FR
status: FIXED
|