Hmm,
But the main issue that I have how to *create the Locale* object to pass it
into the methods. The rest is possible to solve somehow.
Stas
On Thursday, May 14, 2020 at 11:58:48 AM UTC+2, Thomas Broyer wrote:
>
>
>
> On Thursday, May 14, 2020 at 7:30:11 AM UTC+2, foal wrote:
>>
>> Hi,
>>
>> Yes, I have and not happy with it. Can I ask how to emulate some Java
>> methods that required Locale as a parameter? The GWT version is not enough.
>> My version can cause problems. At least I need to describe it correctly on
>> the project page.
>>
>
> I don't mean introducing a new kind of Locale.
> For example, you've added toLanguageTag as an instance method, and
> getAvailableLocales as a static method.
> Then do:
> public class LocaleExt {
> public static String toLanguageTag(Locale locale) { … }
> public static Locale[] getAvailableLocales() { … }
> }
>
> (and for performance, maybe cache the computed language tag in a
> java.util.Map or a JS WeakMap
> <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap#Browser_compatibility>
> )
> and everywhere in your code where you used to call locale.toLanguageTag()
> or Locale.getAvailableLocales() then replace them with
> LocaleExt.toLanguageTag(locale) or LocaleExt.getAvailableLocales()
> respectively.
>
> Then the
> SimpleDateTimeFormatStyleProvider#getFormatter(FormatStyle,FormatStyle,Chronology,Locale)
>
> emulation can keep the exact same signature.
>
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-web-toolkit/892a0a60-aa05-4e8a-af3d-978d8b3d2e40%40googlegroups.com.