aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/i18n
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-28 13:59:48 +0200
committerChocobozzz <me@florianbigard.com>2018-06-28 15:53:12 +0200
commit8afc19a6121569da054462c7cb351a3f13030a32 (patch)
tree6dba42963681062536e635dd3ca401e1c7b0ca9f /shared/models/i18n
parent3ea9a1c311c3e3c55fb95560d4dd99a77c52df4a (diff)
downloadPeerTube-8afc19a6121569da054462c7cb351a3f13030a32.tar.gz
PeerTube-8afc19a6121569da054462c7cb351a3f13030a32.tar.zst
PeerTube-8afc19a6121569da054462c7cb351a3f13030a32.zip
Add ability to choose the language
Diffstat (limited to 'shared/models/i18n')
-rw-r--r--shared/models/i18n/i18n.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts
index e2b440900..14b02a01d 100644
--- a/shared/models/i18n/i18n.ts
+++ b/shared/models/i18n/i18n.ts
@@ -1,8 +1,8 @@
1export const LOCALE_FILES = [ 'player', 'server' ] 1export const LOCALE_FILES = [ 'player', 'server' ]
2 2
3export const I18N_LOCALES = { 3export const I18N_LOCALES = {
4 'en-US': 'English (US)', 4 'en-US': 'English',
5 'fr-FR': 'Français (France)' 5 'fr-FR': 'Français'
6} 6}
7 7
8const I18N_LOCALE_ALIAS = { 8const I18N_LOCALE_ALIAS = {
@@ -13,8 +13,6 @@ const I18N_LOCALE_ALIAS = {
13export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES) 13export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES)
14 .concat(Object.keys(I18N_LOCALE_ALIAS)) 14 .concat(Object.keys(I18N_LOCALE_ALIAS))
15 15
16const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l)
17
18export function getDefaultLocale () { 16export function getDefaultLocale () {
19 return 'en-US' 17 return 'en-US'
20} 18}
@@ -23,6 +21,7 @@ export function isDefaultLocale (locale: string) {
23 return getCompleteLocale(locale) === getCompleteLocale(getDefaultLocale()) 21 return getCompleteLocale(locale) === getCompleteLocale(getDefaultLocale())
24} 22}
25 23
24const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l)
26export function is18nPath (path: string) { 25export function is18nPath (path: string) {
27 return possiblePaths.indexOf(path) !== -1 26 return possiblePaths.indexOf(path) !== -1
28} 27}