From 9f16472264b74345cb8c13dde98a5950253854ad Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Jun 2018 18:04:33 +0200 Subject: Rename fr locale -> fr-FR --- shared/models/i18n/i18n.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'shared') diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts index be1420150..e0e5982f9 100644 --- a/shared/models/i18n/i18n.ts +++ b/shared/models/i18n/i18n.ts @@ -2,11 +2,12 @@ export const LOCALE_FILES = [ 'player', 'server' ] export const I18N_LOCALES = { 'en-US': 'English (US)', - fr: 'French' + 'fr-FR': 'French (France)' } const I18N_LOCALE_ALIAS = { - 'en': 'en-US' + 'en': 'en-US', + 'fr': 'fr-FR' } export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES) @@ -38,6 +39,12 @@ export function getCompleteLocale (locale: string) { return locale } +export function getShortLocale (locale: string) { + if (locale.indexOf('-') === -1) return locale + + return locale.split('-')[0] +} + export function buildFileLocale (locale: string) { const completeLocale = getCompleteLocale(locale) -- cgit v1.2.3