Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Scout Neon i18n: problem with texts at JavaScript level(Texts: ui.NumRowsSelected, ui.NumRowsFiltered, ...)
Scout Neon i18n: problem with texts at JavaScript level [message #1740751] Thu, 18 August 2016 07:03 Go to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
In a simple Scout Application (I have taken the demo Contacts application), how does internationalization support works?

I have set the language configuration in my browser (Chrome) to prefer French
 chrome://settings/search#languages

I now have the feeling the texts I have defined are translated and that the texts that should come from Scout are not.

index.php/fa/26771/0/

This is strange because the corresponded texts are provided by Scout:
 <org.eclipse.scout.rt.ui.html jar>/org/eclipse/scout/rt/ui/html/texts/Texts_fr.properties


What I am missing?
  • Attachment: TablePage.png
    (Size: 12.03KB, Downloaded 321 times)
Re: Scout Neon i18n: problem with texts at JavaScript level [message #1740808 is a reply to message #1740751] Thu, 18 August 2016 16:14 Go to previous message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 205
Registered: November 2010
Senior Member
The texts you have marked with red are so-called "UI texts". Unlike the green texts (which belong to the table and are sent to the UI along the table itself), they are collected when the UI session starts and are sent to the UI in the startup response (the first request to /json).

The UI texts are collected for a specific locale. This locale is taken from the ClientSession. Depending on the implementation (e.g. in execLoad), the locale can be set statically or by reading some user settings from a database. By default, the ClientSession's locale is read from the first HttpRequest's headers.

Note that this means that simply reloading the page after changing the browser's locale is not enough! You will get the same ClientSession as before , and with the same locale as well. You have to logout and login again to create a new ClientSession.

I suggest you first check the HTTP request headers (and the response) using the browser's dev tools. I tried it with the contacts application at https://scout.bsi-software.com/contacts/ and it seemed to be working correctly:

index.php/fa/26778/0/

If this looks alright, make some breakpoints in the Java code to check the locale at these points:

  • org.eclipse.scout.rt.ui.html.UiSession.getTextMap(Locale)
  • org.eclipse.scout.rt.ui.html.UiSession.createAndStartClientSession(Locale, UserAgent, Map<String, String>)


Regards,
Beat
  • Attachment: locale.png
    (Size: 41.04KB, Downloaded 282 times)
Previous Topic:Login Form
Next Topic:[Neon] scout-helloworld-app: default users?
Goto Forum:
  


Current Time: Fri Apr 19 22:21:21 GMT 2024

Powered by FUDForum. Page generated in 0.03260 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top