Opened 15 years ago

Closed 14 years ago

#245 closed defect (fixed)

We are stripping out the regional part of the locale, makes sv-SE becoming only sv

Reported by: mbeckman Owned by: madair
Priority: P2 Milestone: 2.0
Component: Core Version: 1.1.1
Severity: Minor Keywords:
Cc: Browser: All
External ID: Operating System: All
state: New

Description

In fusion.js around line 1075 we strip out the regional part of the locale, so sv-SE becoming only sv. Since the Swedish localization of OpenlLayers is saved as sv-SE OpenlLayers won't find it and therefore use the standard language.

We could do it the same way as they do it in OpenLayers so that we can use both short and long.

setCode: function(code) {

var lang; if(!code) {

code = (OpenLayers.Util.getBrowserName() == "msie") ?

navigator.userLanguage : navigator.language;

} var parts = code.split('-'); parts[0] = parts[0].toLowerCase(); if(typeof OpenLayers.Lang[parts[0]] == "object") {

lang = parts[0];

}

check for regional extensions if(parts[1]) {

var testLang = parts[0] + '-' + parts[1].toUpperCase(); if(typeof OpenLayers.Lang[testLang] == "object") {

lang = testLang;

}

} if(!lang) {

OpenLayers.Console.warn(

'Failed to find OpenLayers.Lang.' + parts.join("-") + ' dictionary, falling back to default language'

); lang = OpenLayers.Lang.defaultCode;

}

OpenLayers.Lang.code = lang;

}

Then we could use the sv-SE translation of OpenLayers without modification.

Change History (2)

comment:1 by madair, 14 years ago

Milestone: Future2.0
Status: newassigned

comment:2 by madair, 14 years ago

Resolution: fixed
Status: assignedclosed

fixed at rev 2093. Changed it so that the full locale parameter value is retained.

Note: See TracTickets for help on using tickets.