archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <br...@apache.org>
Subject Re: i18n in new UI?
Date Mon, 23 Jan 2012 10:22:04 GMT

On 23/01/2012, at 8:04 PM, Olivier Lamy wrote:

> Hello,
> I have started some doc (really work in progress :-) ).
> I will basically focus on provided documentation with code samples.
> 
> Resource bundle are loaded only once when user go to the application.
> 
> For static content some explanations can be read here
> (http://people.apache.org/~olamy/archiva/docs/ref/1.4-M3-SNAPSHOT/archiva-web/archiva-webapp-js/template-loading.html)

Ok, I think I'll need to look closer at the js webapp overall to see how it fits together.

> 
> By default locale is the browser locale except if you have the query
> parameter ?request_lang=en (due to my bad experience with selenium
> tests which failed on my fr machine I did that to be able to force
> locale :-) ).
> 
> 2012/1/23 Brett Porter <brett@apache.org>:
>> Hi,
>> 
>> I haven't had time to wade through all the UI changes yet, but in fixing the JDK
5 compatibility problem this morning, I saw that there is a class serving all the i18n resources
over REST, which are then used in jquery.
>> 
>> I'm curious how this architecture works? My expectation would have been that there
are no localized strings in the static content (HTML/JS), and that the REST calls would return
localized content as requested. Where are the keyed requests coming from?
>> 
>> Also, how does this perform with caching and behave with allowing users to select
the locale?
>> 
>> I did notice that the call generating it is potentially quite inefficient. There
are 2 calls to convert properties to a string (one for redback, which has subcalls, one for
archiva), which both converted back to properties, merged and then back to a string. I'd hope
the resource bundles could just be loaded once (presuming they can be updated as may be needed
in an OSGi scenario later).
>> 
> I miss you here :-).
> There is only on rest call. I have tried to reuse redback i18n.
> There are two properties load (one in en and an other one in the
> request locale except if en is the default). Note it's more 2*2
> (redback then archiva)

In DefaultCommonServices.getAllI18nResources( locale ):
- redback properties are loaded and converted to string
- archiva properties are loaded and converted to string
- redback string is converted back to properties
- archiva string is converted back to properties and added to the same properties instance
- the combined properties is converted back to a string

The class just seemed very confusing - it would be better to just gather all the required
properties in one instance, then write them out to the request with properties.store()?

- Brett

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter
http://twitter.com/brettporter






Mime
View raw message