! moment.js locale configuration ! locale : slovenian (sl) ! author : Robert Sedovšek : https://github.com/sedovsek
519879
function sl__processRelativeTime(number, withoutSuffix, key, isFuture) {
        var result = number + ' ';
        switch (key) {
        case 's':
            return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
        case 'm':
            return withoutSuffix ? 'ena minuta' : 'eno minuto';
        case 'mm':
            if (number === 1) {
                result += withoutSuffix ? 'minuta' : 'minuto';
            } else if (number === 2) {
                result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
            } else if (number < 5) {
                result += withoutSuffix || isFuture ? 'minute' : 'minutami';
            } else {
                result += withoutSuffix || isFuture ? 'minut' : 'minutami';
            }
            return result;
        case 'h':
            return withoutSuffix ? 'ena ura' : 'eno uro';
        case 'hh':
            if (number === 1) {
                result += withoutSuffix ? 'ura' : 'uro';
            } else if (number === 2) {
                result += withoutSuffix || isFuture ? 'uri' : 'urama';
            } else if (number < 5) {
                result += withoutSuffix || isFuture ? 'ure' : 'urami';
            } else {
                result += withoutSuffix || isFuture ? 'ur' : 'urami';
            }
            return result;
        case 'd':
            return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
        case 'dd':
            if (number === 1) {
                result += withoutSuffix || isFuture ? 'dan' : 'dnem';
            } else if (number === 2) {
                result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
            } else {
                result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
            }
            return result;
        case 'M':
            return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
        case 'MM':
            if (number === 1) {
                result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
            } else if (number === 2) {
                result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
            } else if (number < 5) {
                result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
            } else {
                result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
            }
            return result;
        case 'y':
            return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
        case 'yy':
            if (number === 1) {
                result += withoutSuffix || isFuture ? 'leto' : 'letom';
            } else if (number === 2) {
                result += withoutSuffix || isFuture ? 'leti' : 'letoma';
            } else if (number < 5) {
                result += withoutSuffix || isFuture ? 'leta' : 'leti';
            } else {
                result += withoutSuffix || isFuture ? 'let' : 'leti';
            }
            return result;
        }
    }
862077
function normalize(sLocale) {
		var m;
		if ( typeof sLocale === 'string' && (m = rLocale.exec(sLocale.replace(/_/g, '-'))) ) {
			var sLanguage = m[1].toLowerCase();
			sLanguage = M_ISO639_NEW_TO_OLD[sLanguage] || sLanguage;
			var sScript = m[2] ? m[2].toLowerCase() : undefined;
			var sRegion = m[3] ? m[3].toUpperCase() : undefined;
			var sVariants = m[4] ? m[4].slice(1) : undefined;
			var sPrivate = m[6];
			// recognize and convert special SAP supportability locales (overwrites m[]!)
			if ( (sPrivate && (m = rSAPSupportabilityLocales.exec(sPrivate)))
				|| (sVariants && (m = rSAPSupportabilityLocales.exec(sVariants))) ) {
				return "en_US_" + m[1].toLowerCase(); // for now enforce en_US (agreed with SAP SLS)
			}
			// Chinese: when no region but a script is specified, use default region for each script
			if ( sLanguage === "zh" && !sRegion ) {
				if ( sScript === "hans" ) {
					sRegion = "CN";
				} else if ( sScript === "hant" ) {
					sRegion = "TW";
				}
			}
			return sLanguage + (sRegion ? "_" + sRegion + (sVariants ? "_" + sVariants.replace("-","_") : "") : "");
		}
	}
961814
function(key) {
      var values = [], relTime;

      if(this.options.firstItem === 'name') {
        //need both to support moment ver < 2 and  >= 2
        relTime = moment.relativeTime || moment.langData()._relativeTime; 
        var header = typeof relTime[key] === 'function' ? relTime[key](1, true, key, false) : relTime[key];
        //take last entry (see momentjs lang files structure) 
        header = header.split(' ').reverse()[0];                
        values.push(['', header]);
      } else if(this.options.firstItem === 'empty') {
        values.push(['', '']);
      }
      return values;
    }
707530
function serveMagicLocale(request, response) {
    var default_locale_id = 'en-gb',
        found_locale, negotiator;

    if (!request.headers['accept-language']) {
        // No accept-language specified in the request so send the default
        found_locale = default_locale_id;

    } else {
        negotiator = new Negotiator(request);
        found_locale = negotiator.language(cached_available_locales);

        // If a locale couldn't be negotiated, use the default
        found_locale = found_locale || default_locale_id;
    }

    // Send a locale to the browser
    this.file_server.serveFile('/assets/locales/' + found_locale + '.json', 200, {
        Vary: 'Accept-Language',
        'Content-Language': found_locale
    }, request, response);
}
219054
async function mergeMessages(locale, messages) {
  const data_path = path.join(LOCALE_DATA_DIR, `${locale}/api_messages.json`);
  let old_messages = {};
  try {
    old_messages = require(data_path);
  } catch (err) {
    console.log(`creating new messages for locale ${locale}`);
  }
  const merged_messages = { ...old_messages, ...messages };
  const sorted_messages = Object.entries(merged_messages)
    .sort((a, b) => a[0].localeCompare(b[0]))
    .reduce((acc, [key, value]) => {
      acc[key] = value;
      return acc;
    }, {});
  const json = JSON.stringify(sorted_messages, undefined, 2);
  await writeFile(data_path, json);
}
167372
function fixFormat(format, _moment) {
    var i = 5;
    var replace = function (input) {
        return _moment.localeData().longDateFormat(input) || input;
    };
    while (i > 0 && localFormattingTokens.test(format)) {
        i -= 1;
        format = format.replace(localFormattingTokens, replace);
    }
    return format;
}
57485
function read(myLocale) {
    locales[myLocale] = {};
    try {
        locales[myLocale] = JSON.parse(fs.readFileSync(locate(myLocale)));
    } catch(e) {
        console.log('initializing ' + locate(myLocale));
        write(myLocale);
    }
}
1171122
function matchLocale(locale) {
    var found = false;
    if (!locale) return false;
    locale = locale.replace(/_/g, '-').toLowerCase();
    if (localesLookup[locale]) return localesLookup[locale];
    if (options.matchSubTags) {
      while (~locale.indexOf('-')) {
        var index = locale.lastIndexOf('-');
        locale = locale.substring(0, index);
        if (localesLookup[locale]) {
          found = localesLookup[locale];
          break;
        }
      }
    }
    return found;
  }
225448
def currentLocale(self):
        
        try:
            return babel.Locale.parse(self.itemData(self.currentIndex()))
        except ImportError, err:
            log.error('babel is not installed.')
            return None
985653
function getLocale(lang) {
  lang = lang.toLowerCase();
  if (!locales.hasOwnProperty(lang)) {
    locales[lang] = {};
    try {
      locales[lang] = require('../locale/' + lang);
    } catch (err) {
      if (lang !== 'en') {
        return getLocale('en');
      }
      // This is not reachable, unless someone deletes ../locale/en.json
      throw err;
    }
  }

  return locales[lang];
}
1115343
function(numbers) {
    if (numbers.length < 2) {
      return moment()._locale.ordinal(numbers);
    }

    var last_val = numbers.pop();
    return numbers.join(', ') + ' and ' + moment()._locale.ordinal(last_val);
  }
1017044
function(body, error, code, errorTraceId, errorUserTitle, errorUserMessage) {
            _$jscmd("utils.js", "line", 104);
            //TODO: support errorTraceId
            //TODO: errorUserTitle and errorUserMessage should be change from strings to ints (==code) to support localization
            var response = {};
            //set code
            if (_$jscmd("utils.js", "cond", "107_7_26", !__isNullOrUndefined(code))) {
                _$jscmd("utils.js", "line", 108);
                response.code = code;
            } else {
                if (_$jscmd("utils.js", "cond", "111_8_26", !__isNullOrUndefined(body))) response.code = 0; else //if (!__isNullOrUndefined(error))
                response.code = 1e3;
            }
            //set body
            if (_$jscmd("utils.js", "cond", "118_7_26", !__isNullOrUndefined(body))) response.body = body;
            //set error
            if (_$jscmd("utils.js", "cond", "122_7_27", !__isNullOrUndefined(error))) {
                _$jscmd("utils.js", "line", 123);
                response.error = error;
                //set errorTraceId
                if (_$jscmd("utils.js", "cond", "126_8_34", !__isNullOrUndefined(errorTraceId))) response.errorTraceId = errorTraceId;
                //set errorUserTitle
                if (_$jscmd("utils.js", "cond", "130_8_36", !__isNullOrUndefined(errorUserTitle))) response.errorUserTitle = errorUserTitle; else {
                    _$jscmd("utils.js", "line", 134);
                    //TODO: this is not the real implementation
                    response.errorUserTitle = "Bolt Error " + response.code.toString();
                }
                //set errorUserMessage
                if (_$jscmd("utils.js", "cond", "138_8_38", !__isNullOrUndefined(errorUserMessage))) response.errorUserMessage = errorUserMessage; else {
                    _$jscmd("utils.js", "line", 142);
                    //TODO: this is not the real implementation
                    response.errorUserMessage = errors[response.code];
                }
            }
            _$jscmd("utils.js", "line", 146);
            return JSON.stringify(response);
        }
505942
function localeFormat (d, format) {
        var tokens = format.match(/(%E.|%O.|%.)/g);

        for (var i = 0; tokens && i < tokens.length; i++) {
            var value = '';

            // http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html
            switch (tokens[i]) {
            // localized day/month names
            case '%a':
                value = _('weekday-' + d.getDay() + '-short');
                break;
            case '%A':
                value = _('weekday-' + d.getDay() + '-long');
                break;
            case '%b':
            case '%h':
                value = _('month-' + d.getMonth() + '-short');
                break;
            case '%B':
                value = _('month-' + d.getMonth() + '-long');
                break;
            case '%Eb':
                value = _('month-' + d.getMonth() + '-genitive');
                break;

            // like %H, but in 12-hour format and without any leading zero
            case '%I':
                value = d.getHours() % 12 || 12;
                break;

            // like %d, without any leading zero
            case '%e':
                value = d.getDate();
                break;

            // %p: 12 hours format (AM/PM)
            case '%p':
                value = d.getHours() < 12 ? _('time_am') : _('time_pm');
                break;

            // localized date/time strings
            case '%c':
            case '%x':
            case '%X':
            // ensure the localized format string doesn't contain any %c|%x|%X
                var tmp = _('dateTimeFormat_' + tokens[i]);
                if (tmp && !(/(%c|%x|%X)/).test(tmp)) {
                    value = localeFormat(d, tmp);
                }
                break;

            // other tokens don't require any localization
            }

            format = format.replace(tokens[i], value || d.toLocaleFormat(tokens[i]));
        }

        return format;
    }
667496
public void setLocale(Locale l) {
		super.setLocale(l);
		dateEditor.setLocale(l);
		jcalendar.setLocale(l);
	}
1064882
function ignoreMomentLocale(webpackConfig) {
  delete webpackConfig.module.noParse;
  webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/));
}
876415
function getLocaleDayNames(locale, formStyle, width) {
    var /** @type {?} */ data = findLocaleData(locale);
    var /** @type {?} */ daysData = /** @type {?} */ ([data[3 /* DaysFormat */], data[4 /* DaysStandalone */]]);
    var /** @type {?} */ days = getLastDefinedValue(daysData, formStyle);
    return getLastDefinedValue(days, width);
}
120963
def set_locale(ln):
    
    ctx = _request_ctx_stack.top
    if ctx is None:
        raise RuntimeError('Working outside of request context.')
    new_locale = current_app.extensions['babel'].load_locale(ln)
    old_locale = getattr(ctx, 'babel_locale', None)
    setattr(ctx, 'babel_locale', new_locale)
    yield
    setattr(ctx, 'babel_locale', old_locale)