A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mapbox/locale-utils below:

GitHub - mapbox/locale-utils

A helper library for finding an appropriate locale from a list of available locales given an input locale.

npm install @mapbox/locale-utils --save
var locale = require('@mapbox/locale-utils');

var availableLocales = [
    'en-US',
    'en-GB',
    'es-ES',
    'pt-PT',
    'tr',
    'zh-Hans'
];

// Find the best fitting locale given an input locale
var newLocale = locale.bestMatchingLocale('es-MX', availableLocales);
// Returns `es-ES` since `es-MX` is not an available locale.


// Parse a locale into smaller, easier to understand pieces.
var codedLocale = locale.parseLocaleIntoCodes('es-MX');
// Returns:
// {
//     locale: 'es-MX',
//     language: 'es',
//     script: undefined,
//     region: 'MX'
// }

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4