[ovirt-devel] [ACTION REQUESTED] i18n default English text is now stored in properties files

Scott Dickerson sdickers at redhat.com
Tue May 24 13:17:29 UTC 2016


response inline

On Tue, May 24, 2016 at 5:29 AM, Martin Sivak <msivak at redhat.com> wrote:

> Hi,
>
> We still have three almost identical files. Can we somehow keep just
> one and generate the other two? I was actually playing a bit with a
> change in the opposite direction - keeping just the EngineMessages
> enum with added default english translations and generating all other
> files from it.
>

Are you talking about some files in specific, and if so which ones?


> Do you think it would make sense? It would not require a test then as
> the consistency would be checked during compilation phase directly.
>

Sure, generating some code from a key/message file could be useful.  The
difficulty comes in when we have Messages or Constants interface that
inherit from a common ancestor.  That construct is used a few times to
share messages between both the user portal and the admin portal.

The primary reasons this change was done was to simplify translation and to
better manage workflow between language files in gerrit and documents in
Zanata.  With this change, there is now a 1 to 1 mapping of properties
files to zanata documents.  Well, for the front end i18n code at least.
The current translations for 4.0 can be seen here:

   https://translate.zanata.org/iteration/view/ovirt/master/documents

We will be making additional i18n changes for 4.1, so any input is very
welcome.


> Martin
>
> On Mon, May 23, 2016 at 7:38 PM, Scott Dickerson <sdickers at redhat.com>
> wrote:
> > Hi,
> >
> > In order to resolve bug [1] and prep [2], the default English text for
> I18N
> > Constants and Messages have been moved to their corresponding properties
> > files.  Going forward, if a new constant or message needs to be added,
> > please add the key method to the proper interface and then add the key
> plus
> > English text to the interface's corresponding properties file.  Checks
> will
> > be added, in the next few days, to fail the build process if the GWT
> > annotations (@DefaultStringValue, @DefaultMessage) are used.
> >
> > This change has been made to simplify the translation process [1] and to
> > prepare for the replacement of the GWT i18n engine in 4.1 [2].
> >
> > For example, in the webadmin project, the ApplicationConstants [3]
> interface
> > previously looked like:
> >    package org.ovirt.engine.ui.webadmin;
> >
> >    import org.ovirt.engine.ui.common.CommonApplicationConstants;
> >
> >    public interface ApplicationConstants extends
> CommonApplicationConstants
> > {
> >
> >        @DefaultStringValue("oVirt Engine Web Administration")
> >        String applicationTitle();
> >
> >        @DefaultStringValue("About")
> >        String aboutPopupCaption();
> >
> >        @DefaultStringValue("oVirt Engine Version:")
> >        String ovirtVersionAbout();
> >
> > Now, the interface looks like this [4]:
> >    package org.ovirt.engine.ui.webadmin;
> >
> >    import org.ovirt.engine.ui.common.CommonApplicationConstants;
> >
> >    public interface ApplicationConstants extends
> CommonApplicationConstants
> > {
> >        String applicationTitle();
> >
> >        String aboutPopupCaption();
> >
> >        String ovirtVersionAbout();
> >
> > With a new properties file created, ApplicationContants.properties [5],
> with
> > this kind of content :
> >    #
> >    #
> >    # Bundle name: org.ovirt.engine.ui.webadmin.ApplicationConstants
> >    #
> >    #
> >    #Thu May 19 01:24:21 EDT 2016
> >    aboutPopupCaption=About
> >    applicationTitle=oVirt Engine Web Administration
> >    ovirtVersionAbout=oVirt Engine Version\:
> >
> > Let me know if there are any questions.
> >
> > Regards,
> > Scott
> >
> > --
> > Scott Dickerson
> > Senior Software Engineer
> > RHEV-M Engineering - UX Team
> > Red Hat, Inc
> >
> >
> > [1] - https://bugzilla.redhat.com/show_bug.cgi?id=1224423
> > [2] - https://bugzilla.redhat.com/show_bug.cgi?id=1287408
> > [3] -
> >
> https://github.com/oVirt/ovirt-engine/blob/569695916d2325d0c1e1fdabb6f85cd9e97d7232/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
> > [4] -
> >
> https://github.com/oVirt/ovirt-engine/blob/master/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
> > [5] -
> >
> https://github.com/oVirt/ovirt-engine/blob/master/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/ApplicationConstants.properties
> >
> > _______________________________________________
> > Devel mailing list
> > Devel at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20160524/472a06b4/attachment-0001.html>


More information about the Devel mailing list