Hi Isomorphic,
I'm using DataSourceLocalization using <fmt>-tags, which is working great.
So far, the localisation of the DataSourceLoader and the GWT-Application is based on the request's locale (this is the default).
Now I'm implementing a cookie based language selection which can override the default request's locale. I'm reading the cookie in my bootstrap html (or more exactly jsp) file and apply it like this:
This is also working fine and documented in the DataSourceLocalization docs:
But I also do have a DataSource with a DynamicDSGenerator that I load from within the application like this:
Here, DataSource.load() has no overload where I could specify a locale. Can you add it (5.1p)?
In a related area (l10n of IDACall), I think a static method getActionURL() is missing. I'd like to do this:
If this is reasonable and the correct way to do it, could you add this one as well to 5.1p?
Thank you & Best regards
Blama
I'm using DataSourceLocalization using <fmt>-tags, which is working great.
So far, the localisation of the DataSourceLoader and the GWT-Application is based on the request's locale (this is the default).
Now I'm implementing a cookie based language selection which can override the default request's locale. I'm reading the cookie in my bootstrap html (or more exactly jsp) file and apply it like this:
Code:
<meta name="gwt:property" content="[B]locale=<%=userLanguage %>[/B]"> ... <script src="lms/sc/DataSourceLoader<%=version %>&[B]locale=<%=userLanguage %>[/B]&dataSource=<%=outputDataSources()%>"></script>
This will cause Smart GWT Server to look for a ResourceBundle called "supplyItem", containing keys "itemTitle" and "itemLengthRangeValidator", and replace the <fmt:message> tags with the values from the resource bundle in the expected way. It obtains the user's Locale from the servlet request, but you can override this if you want to force an application-specific locale, regardless of the user's operating system settings. To do this, specify a "locale" parameter on HTTP requests to the DataSourceLoader and IDACall servlets (the latter is typically done via actionURL).
Code:
DataSource.load(dataSourceName, new Function() { @Override public void execute() { batchUploader.setUploadDataSource(DataSource.get(dataSourceName)); mainWindowLayout.addMember(batchUploader, 1); batchUploader.getUploadButton().enable(); } });
In a related area (l10n of IDACall), I think a static method getActionURL() is missing. I'd like to do this:
Code:
RPCManager.setActionURL(RPCManager.getActionURL() + "&locale=" + myLocaleString);
Thank you & Best regards
Blama
Comment