mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-29 19:29:35 +02:00
detectedLocale can be undefined
This commit is contained in:
+2
-2
@@ -39,11 +39,11 @@ window.iD = function () {
|
||||
|
||||
var detectedLocale = iD.detect().locale;
|
||||
|
||||
if (iD.data.locales.indexOf(detectedLocale) === -1) {
|
||||
if (detectedLocale && iD.data.locales.indexOf(detectedLocale) === -1) {
|
||||
detectedLocale = detectedLocale.split('-')[0];
|
||||
}
|
||||
|
||||
if (detectedLocale !== 'en' && iD.data.locales.indexOf(detectedLocale) !== -1) {
|
||||
if (detectedLocale && detectedLocale !== 'en' && iD.data.locales.indexOf(detectedLocale) !== -1) {
|
||||
d3.json(context.assetPath() + 'locales/' + detectedLocale + '.json', function(err, result) {
|
||||
locale[detectedLocale] = result;
|
||||
locale.current(detectedLocale);
|
||||
|
||||
Reference in New Issue
Block a user