diff options
Diffstat (limited to 'shared/models/i18n')
-rw-r--r-- | shared/models/i18n/i18n.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts index 36688382d..27b911b75 100644 --- a/shared/models/i18n/i18n.ts +++ b/shared/models/i18n/i18n.ts | |||
@@ -69,11 +69,11 @@ export function peertubeTranslate (str: string, translations?: { [ id: string ]: | |||
69 | 69 | ||
70 | const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) | 70 | const possiblePaths = POSSIBLE_LOCALES.map(l => '/' + l) |
71 | export function is18nPath (path: string) { | 71 | export function is18nPath (path: string) { |
72 | return possiblePaths.indexOf(path) !== -1 | 72 | return possiblePaths.includes(path) |
73 | } | 73 | } |
74 | 74 | ||
75 | export function is18nLocale (locale: string) { | 75 | export function is18nLocale (locale: string) { |
76 | return POSSIBLE_LOCALES.indexOf(locale) !== -1 | 76 | return POSSIBLE_LOCALES.includes(locale) |
77 | } | 77 | } |
78 | 78 | ||
79 | export function getCompleteLocale (locale: string) { | 79 | export function getCompleteLocale (locale: string) { |
@@ -85,7 +85,7 @@ export function getCompleteLocale (locale: string) { | |||
85 | } | 85 | } |
86 | 86 | ||
87 | export function getShortLocale (locale: string) { | 87 | export function getShortLocale (locale: string) { |
88 | if (locale.indexOf('-') === -1) return locale | 88 | if (locale.includes('-') === false) return locale |
89 | 89 | ||
90 | return locale.split('-')[0] | 90 | return locale.split('-')[0] |
91 | } | 91 | } |