aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/i18n/i18n.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-06 18:04:33 +0200
committerChocobozzz <me@florianbigard.com>2018-06-06 18:04:33 +0200
commit9f16472264b74345cb8c13dde98a5950253854ad (patch)
tree76f2cc81fd87d8b0065cabc57d9268136cf0bb0b /shared/models/i18n/i18n.ts
parent74b7c6d48e9ca377fe938c8134ed74b612e62ba0 (diff)
downloadPeerTube-9f16472264b74345cb8c13dde98a5950253854ad.tar.gz
PeerTube-9f16472264b74345cb8c13dde98a5950253854ad.tar.zst
PeerTube-9f16472264b74345cb8c13dde98a5950253854ad.zip
Rename fr locale -> fr-FR
Diffstat (limited to 'shared/models/i18n/i18n.ts')
-rw-r--r--shared/models/i18n/i18n.ts11
1 files changed, 9 insertions, 2 deletions
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' ]
2 2
3export const I18N_LOCALES = { 3export const I18N_LOCALES = {
4 'en-US': 'English (US)', 4 'en-US': 'English (US)',
5 fr: 'French' 5 'fr-FR': 'French (France)'
6} 6}
7 7
8const I18N_LOCALE_ALIAS = { 8const I18N_LOCALE_ALIAS = {
9 'en': 'en-US' 9 'en': 'en-US',
10 'fr': 'fr-FR'
10} 11}
11 12
12export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES) 13export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES)
@@ -38,6 +39,12 @@ export function getCompleteLocale (locale: string) {
38 return locale 39 return locale
39} 40}
40 41
42export function getShortLocale (locale: string) {
43 if (locale.indexOf('-') === -1) return locale
44
45 return locale.split('-')[0]
46}
47
41export function buildFileLocale (locale: string) { 48export function buildFileLocale (locale: string) {
42 const completeLocale = getCompleteLocale(locale) 49 const completeLocale = getCompleteLocale(locale)
43 50