|Summary:||RFE: Use "Localized Properties Files" for GWT translation, not annotations|
|Product:||[Retired] Zanata||Reporter:||Sean Flanigan <sflaniga>|
|Component:||Component-UI||Assignee:||Patrick Huang <pahuang>|
|Status:||CLOSED UPSTREAM||QA Contact:||Zanata-QA Mailling List <zanata-qa>|
|Version:||development||CC:||dchen, djansen, zanata-bugs|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2015-07-29 03:24:25 UTC||Type:||Bug|
|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 to use "Localized Properties Files" rather than @DefaultMessage annotations, 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. 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.  http://www.gwtproject.org/doc/latest/DevGuideI18n.html#DevGuideStaticStringInternationalization  http://www.gwtproject.org/doc/latest/DevGuideI18n.html#DevGuidePropertiesFiles  http://www.gwtproject.org/doc/latest/DevGuideI18n.html#DevGuideAnnotations  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.