Bug 1066203 - RFE: Use "Localized Properties Files" for GWT translation, not annotations
Summary: RFE: Use "Localized Properties Files" for GWT translation, not annotations
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Zanata
Classification: Retired
Component: Component-UI
Version: development
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Patrick Huang
QA Contact: Zanata-QA Mailling List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-18 02:33 UTC by Sean Flanigan
Modified: 2015-07-29 03:24 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-29 03:24:25 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1002378 0 unspecified CLOSED RFE: Introduce a modular translation structure, and gwt generate the *Messages.properties files 2021-02-22 00:41:40 UTC

Internal Links: 1002378

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.



[1] http://www.gwtproject.org/doc/latest/DevGuideI18n.html#DevGuideStaticStringInternationalization

[2] http://www.gwtproject.org/doc/latest/DevGuideI18n.html#DevGuidePropertiesFiles

[3] http://www.gwtproject.org/doc/latest/DevGuideI18n.html#DevGuideAnnotations

[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: http://zanata.atlassian.net/browse/ZNTA-246


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