Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1066203

Summary: RFE: Use "Localized Properties Files" for GWT translation, not annotations
Product: [Retired] Zanata Reporter: Sean Flanigan <sflaniga>
Component: Component-UIAssignee: Patrick Huang <pahuang>
Status: CLOSED UPSTREAM QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: developmentCC: dchen, djansen, zanata-bugs
Target Milestone: ---Keywords: i18n
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-29 03:24:25 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:

Description Sean Flanigan 2014-02-18 02:33:49 UTC
I suggest we switch Zanata's GWT translations[1] to use "Localized Properties Files"[2] rather than @DefaultMessage annotations[3], with a view to making it the recommended GWT solution for Zanata-based projects.

According to the GWT docs, this approach uses "traditional Java .properties files" and going by the properties files in the Guvnor project, it does support '\n' sequences[4].  It also removes the need to generate .properties files by running a GWT compile, which should make life easier and save some time.  It even seems to use the standard directory layout for properties files, which might remove the need for our client-side command hooks.

The only drawback seems to be the duplication of properties keys between the .java interface and the .properties file, but on the whole it seems like a much simpler and safer approach, at least if it really uses "traditional Java .properties files".

Put simply, we would move the English text out of the @DefaultMessage annotations in our Messages interfaces, and into .properties files (which we can generate from the @DefaultMessage annotations).  The .properties files would then be checked in like any other source code.  We would also change the build process to pick up the translations from the .properties files.  When it comes to pushing content into Zanata for translation, we will be able to pick it up just the same as we do for our JSF pages, instead of having to run a partial build to generate the files.




[4] Newlines in @DefaultMessage cause trouble, because GWT generates an incompatible .properties file with <backslash><newline> instead of using using '\n'.

Comment 1 Sean Flanigan 2014-03-26 07:23:59 UTC
I think this deserves a higher severity, because (apart from the impediment of maintaining build code for GWT properties generation) we don't want to encourage other projects to use GWT's broken generated .properties files, and we ought to get experience with doing it the right way.

Comment 2 Zanata Migrator 2015-07-29 03:24:25 UTC
Migrated; check JIRA for bug status: