SV: [fusion-users] problem with localization of fusion, i think i found a bug...

Måns Beckman mans.beckman at manandmachine.se
Fri Apr 17 07:11:16 EDT 2009


Ok, so here is the problem. We are always sending two letter lang codes to Open Layers, that works great for some languages, but not others. For example to recognize Swedish open layers wants the code sv-SE. We will need to fix this in some way. 

Cheers
Måns
	
-----Ursprungligt meddelande-----
Från: fusion-users-bounces at lists.osgeo.org [mailto:fusion-users-bounces at lists.osgeo.org] För Måns Beckman
Skickat: den 17 april 2009 12:07
Till: fusion-users at lists.osgeo.org
Ämne: [fusion-users] problem with localization of fusion,i think i found a bug...

Hi, 

Ok, I'm still no coder, but I found something that isn't working as it should. I was trying to localize fusion in MGE2010 and it wouldn't read my localization, so I did some code digging and found something strange. 

In this snippet from fusion.js something isn't working as it should.

        initializeLocale: function(locale) {
          OpenLayers.Lang.setCode(locale ? locale : window._FusionLocale);
          this.locale = OpenLayers.Lang.code;

To see what's happening in a simple way I modified it like this.

        initializeLocale: function(locale) {
alert(window._FusionLocale);
alert(locale?locale:window._FusionLocale)
OpenLayers.Lang.setCode(locale?locale:window._FusionLocale);this.locale=OpenLayers.Lang.code;
alert(OpenLayers.Lang.code)

And the result I got was in my case where I'm using a Swedish browser "sv", so window._FusionLocale is correct, "sv", so locale?locale:window._FusionLocale is reporting what I want, but then I get "en", so by some reason OpenLayers.Lang.code is reporting "en".

Anyone who can explain why, and what I need to do to get it to work? (I can think of some quick and dirty ways to fix it, but clean code is nicer.)

Cheers
Måns
_______________________________________________
fusion-users mailing list
fusion-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fusion-users

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.287 / Virus Database: 270.11.58/2061 - Release Date: 04/16/09 16:38:00


More information about the fusion-users mailing list