Friday, January 7, 2022

Re: Only picking up Default locale values in some places

From the code you shared, I see no issues (although I don't understand your comment "made easier to distinguish with the prefixed '@'" and I don't know the values that are checked inside your "getShortcutPrettyHtml()" method).
I would check four things:
1. The logic of "getShortcutPrettyHtml()" and make sure is doing what you think is doing.
2. Make sure you're not overriding the locale from the url ("?locale=EN" IIRC).
3. If you're selecting the active locale by what the browser has as default, perhaps you're accessing your app from a browser that has a locale that you didn't expect or knew it had?
4. Make sure your properties file has the value you were expecting for the locale you're testing (most times we start new locale's properties files by copying the default locale's file).


On Thursday, January 6, 2022 at 10:20:35 AM UTC-7 Skye wrote:
Hi all,

I have a widget that is being built using SafeHtmlBuilder. The widget consists of some tables, and within the <td> elements I am calling on a Messages interface to retrieve localized values.

widget.PNG

The call to info.getDescription() grabs the correct locale value (made easier to distinguish with the prefixed "@"). However, the call to info.getCommand().getShortcutPrettyHtml() ultimately results in the Default locale value (no "@" prefix):

panel.PNG

Here is what info.getCommand().getShortcutPrettyHtml() is returning (either an empty string or the string msg from the Messages interface):

constants.PNG

Where constants_ is a ref to the Messages interface, which contains for example:

msg.PNG

With the expected locale value being found in the prop file:

props.PNG

I'm pretty stumped as to how/why sometimes the Default locale value is used, and other times the active locale value. Any help is much appreciated!

Thanks in advance

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/ebb6c486-3e86-4681-bbbe-5375d701af48n%40googlegroups.com.

No comments:

Post a Comment