Locale - combination of multiple locales

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Locale - combination of multiple locales

kirra5
Hi

Is it possible to combine/use different locale information on two parts of the same application?

For example: the whole application should have the locale "en", but a specific part (this can be, for example, a form) of the application should be using the locale "de".  

I was thinking about using the "qx.locale.Manager.getInstance().localize(...)" function, but then I saw that it would not be possible to create a dynamic solution this way.

Is there any other possible solution for this?

Thank you very much for your help!



Reply | Threaded
Open this post in threaded view
|

Re: Locale - combination of multiple locales

Peter Schneider
Hello,

one possible "solution" / work-around might be just to override the 'tr'
method in that specific dialog.
That overridden method will always use the "de" locale for example

--------------------------------------------------------------------------
qx.Class.define("app.ui.FooDialog",
{
  extend : qx.ui.window.Window,
  //...
  members :
  {
    // overridden
    tr : function (messageId, varargs)
    {
      var args = qx.lang.Array.fromArguments(arguments);
      args.splice(0, 1);
      return qx.locale.Manager.getInstance().translate(messageId, args, "de);
    }
    //...
  }
});
--------------------------------------------------------------------------

Only disadvantage is, that those LocalizedStrings will still react on any
'changeLocale' events that might be fired in your app.
But if that isn't the case: This might do the trick!

/Peter


On 2/12/2014 9:22 AM kirra5 wrote:

> Hi
>
> Is it possible to combine/use different locale information on two parts of
> the same application?
>
> *For example:* the whole application should have the locale "en", but a
> specific part (this can be, for example, a form) of the application should
> be using the locale "de".  
>
> I was thinking about using the
> "qx.locale.Manager.getInstance().localize(...)" function, but then I saw
> that it would not be possible to create a dynamic solution this way.
>
> Is there any other possible solution for this?
>
> Thank you very much for your help!
--

** Unsere Veranstaltungen:

LogiMAT in Stuttgart, Halle 5 - Stand 200, 25.-27.02.2014
T-Matik in Greven, 20.05.2014
Post-Expo in Stockholm, Halle A - Stand A10.05, 23.-25.09.2014
transfairlog in Hamburg, 04.-06.11.2014

Bitte auch vormerken: TIS-Hausmesse im Oktober - Termin wird noch bekannt gegeben.


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Locale - combination of multiple locales

thron7
In reply to this post by kirra5
On Wed, Feb 12, 2014 at 9:22 AM, kirra5 <[hidden email]> wrote:

> Hi
>
> Is it possible to combine/use different locale information on two parts of
> the same application?
>
> *For example:* the whole application should have the locale "en", but a
> specific part (this can be, for example, a form) of the application should
> be using the locale "de".
>
> I was thinking about using the
> "qx.locale.Manager.getInstance().localize(...)" function, but then I saw
> that it would not be possible to create a dynamic solution this way.

Just use qx.locale.Manager.getInstance().setLocale("de") when you
enter the form, and then set it back when you leave it.

T.

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Locale - combination of multiple locales

kirra5
Thank you for your help! But unfortunately, this is not a solution.

The "changeLocale" events will be fired and will need to update all the components properly.

I can't change the setLocale, when I enter the form, because multiple forms will be visible at the same time (and also other components) and they will need to have different locales at the same time.