[gradebook2-dev] Internationalization in GB2

Thomas Amsler tpamsler at ucdavis.edu
Tue Oct 26 13:04:57 PDT 2010


Jim,

Please see inline comments bellow:

On Tue, Oct 26, 2010 at 11:22 AM, Jim Eng <jimeng at umich.edu> wrote:
> Thanks, Thomas.  Especially for the link to the GWT i18n Dev Guide.  A link to that should be added to the page Beth referenced.
>
> I have a couple questions, if you know the answers (if not, we'll figure it out). Very early in the GWT Dev Guide, it makes
> reference to working within a web app that is part of a larger system with different i18n functionality.  Is there somewhere in the
> GB2 code that connects up with Sakai's i18n impl's to get the default locale and the user's preferred locale (if that is different)?

No

 > And then within GB2 code, can we assume that the GWT code will
honor those settings for locale for the current user?

Assuming that you support multiple translations, the user locales are
defined/selected as described here:

http://code.google.com/webtoolkit/doc/latest/DevGuideI18nLocale.html

Let me know if I didn't fully answer this last question ?

Best,
-- Thomas


>
> Jim
>
>
>
> On Oct 26, 2010, at 12:51 PM, Thomas Amsler wrote:
>
>> In gradebook2, we are using the GWT i18n support as outlined here:
>> http://code.google.com/webtoolkit/doc/latest/DevGuideI18n.html
>>
>> The gradebook2 specific files are located here:
>>
>> https://source.sakaiproject.org/contrib//gradebook2/trunk/shared/src/java/org/sakaiproject/gradebook/gwt/client/
>>
>> I18nConstants.java
>> I18nConstants.properties
>> I18nMessages.java
>> I18nMessages.properties
>>
>> I have also created:
>> http://jira.sakaiproject.org/browse/GRBK-770
>>
>> ..., which we will use to cleanup all remaining i18n issues.
>>
>> Best,
>> -- Thomas
>>
>>
>>
>> On Mon, Oct 25, 2010 at 11:35 AM, Jim Eng <jimeng at umich.edu> wrote:
>>> I would like to ask about the way that i18n is done in GB2. I noticed a few
>>> places where strings were created by appending strings and numbers in
>>> various orders to assemble a string to be displayed in the UI. That is sort
>>> of like the approach we took back in the earliest days of sakai:
>>>
>>> String str = rl.getString("hey-there") + user.getName() +
>>> rl.getString("how-ya-doing");
>>>
>>> It turns out that the order of words in a sentence may be different in
>>> different languages. :-)
>>>
>>> Instead of that, we now add a string to the language bundle that looks
>>> something like this:
>>>
>>> hey-how-ya-doin = Hey, there, {0}! How ya doing!?
>>>
>>> Then we call a method on the resource loader that inserts the value of
>>> user.getName() into the string in place of the placeholder "{0}". A string
>>> can have zero or more placeholders, and our code must supply values for each
>>> of them. Not sure exactly how the resource loader shows up in GB2, but it
>>> should use this pattern also. If that's not the way it's done in the
>>> existing GB2 codebase, as we revise things and add to it, we should make it
>>> work like that.
>>>
>>> Jim
>>>
>>> ________________________________
>>> This automatic notification message was sent by SmartSite at UCDavis
>>> (https://smartsite.ucdavis.edu/xsl-portal) from the UCD Sakai Dev site.
>>> You can modify how you receive notifications at My Workspace > Preferences.
>>>
>>
>>
>
>


More information about the gradebook2-dev mailing list