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

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


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


More information about the fusion-users mailing list