[fusion-users] Language problems.

Tómas Guðmundsson tomas at snertill.is
Fri May 23 10:34:41 EDT 2008


Mike.

I'm sorry to say that Fusion.initializeLocale() would not work, simply
because I believe that in the bootstrap function of the fusion.js the 
locale files are loaded and if you call initializeLocale() and you 
don't have a Icelandic or French version loaded it's cannot be loaded.

So far I've thought of two solutions to this but I can't implement one
of them yet. One is to load through an Ajax call, a script (one that 
I've already made) like getUsersLocales.php which returns a list of 
locales that are read by a server side script (php, jsp, asp) and it
would be checked against supported locales and the first locale to 
match would load. The other one is to load all locales available (takes
up a lot of memory) and then use a function that switches to a locale
in a page that could read the locale of a user. 

The reason I'm so pro server-side is because that, they way it is done
now in fusion excludes everybody except Internet Explorer. The 
JavaScript machine in Internet Explorer does have a property called 
navigator.userLanguage, and navigator.systemLanguage as well but when
you call for that in Firefox you get undefined. It does though have a
navigator.language but after have changed my settings numerous times, 
restarting firefox, cleaning my cache and all sorts of tricks nothing 
seems to effect the outcome, which always ends up to be en-GB. And come
to think of it, using Firefox 3.0 RC1 I DID download it with the 
language en-GB, which is in fact the language of my application firefox.
It is though not the preferred language I would like to read my web 
pages in, which is Icelandic (navigator.userLanguage).

Does this deserve its own ticket ?;)

Regards,
Tómas.


-----Original Message-----
From: Mike Adair [mailto:madair at dmsolutions.ca] 
Sent: 23. maí 2008 13:12
To: Tómas Guðmundsson
Cc: fusion-users at lists.osgeo.org
Subject: Re: [fusion-users] Language problems.

Tomas,

In testing and developing the I18n for Fusion and OL, I found that 
setting the locale option for the browser only gets picked up after the 
browser is restarted.  That's not very intuitive, but I guess that most 
users would set that option once and leave it like that.

And in Javascript, we only have access to the 'navigator' object (which 
reflects the browser locale setting) - we don't have access to 
Accept-Language request headers which means request headers can only be 
read server-side, which means those headers have limited usefulness for 
a client like Fusion.

If you need dynamic language toggling, you can try putting a link on the 
page which calls Fusion.initializeLocale().

Those 2 translation files are where all the strings are intended to be 
stored but it is likely that there are still hardcoded English strings 
in Fusion, OL should have all it's strings in the OL translation file 
now.  We have an outstanding task is to go through and clean that up, 
but note that there will also be a lot of text that comes from the 
AppDef file for button labels, menu labels, etc.

And yes an Icelandic translation for Fusion (and for the OpenLayers part 
too!) would be appreciated.

Mike


Tómas Guðmundsson wrote:
> Hi all.
>
> I'm running into problems with translating Fusion. I found a php script that tells me what languages I want, sent via the Accept-Language in the HTTP header information. I now have the settings "is, en, fr" in use, when I do "console.log(navigator.language)" just before the Fusion.locale is set in fusion.js I get en-GB. So, how does one make it so that the javascript reads "a correct" settings for the languages ? It is really painful realizing that the ultimatum is using a "locale=is" in the URL.
>
> Also,  can anyone tell me where the translations strings for all the widget buttons, like in the toolbar and the context menu is? Other than text/locale/strings.json and lib/OpenLayers/Strings/locale.js ?
>
> And yeah, if anyone wants an Icelandic translation of Fusion I'll see what I can do :)
>
> Regards,
> Tómas.
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
>   


More information about the fusion-users mailing list