Rename fr locale -> fr-FR
This commit is contained in:
parent
74b7c6d48e
commit
9f16472264
5 changed files with 2902 additions and 4 deletions
|
@ -12,7 +12,7 @@ import './peertube-videojs-plugin'
|
||||||
import './peertube-load-progress-bar'
|
import './peertube-load-progress-bar'
|
||||||
import { videojsUntyped } from './peertube-videojs-typings'
|
import { videojsUntyped } from './peertube-videojs-typings'
|
||||||
import { buildVideoEmbed, buildVideoLink, copyToClipboard } from './utils'
|
import { buildVideoEmbed, buildVideoLink, copyToClipboard } from './utils'
|
||||||
import { getCompleteLocale, is18nLocale, isDefaultLocale } from '../../../../shared/models/i18n/i18n'
|
import { getCompleteLocale, getShortLocale, is18nLocale, isDefaultLocale } from '../../../../shared/models/i18n/i18n'
|
||||||
|
|
||||||
// Change 'Playback Rate' to 'Speed' (smaller for our settings menu)
|
// Change 'Playback Rate' to 'Speed' (smaller for our settings menu)
|
||||||
videojsUntyped.getComponent('PlaybackRateMenuButton').prototype.controlText_ = 'Speed'
|
videojsUntyped.getComponent('PlaybackRateMenuButton').prototype.controlText_ = 'Speed'
|
||||||
|
@ -147,7 +147,7 @@ function loadLocale (serverUrl: string, videojs: any, locale: string) {
|
||||||
|
|
||||||
return fetch(serverUrl + '/client/locales/' + completeLocale + '/player.json')
|
return fetch(serverUrl + '/client/locales/' + completeLocale + '/player.json')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => videojs.addLanguage(completeLocale, json))
|
.then(json => videojs.addLanguage(getShortLocale(completeLocale), json))
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
2891
client/src/locale/target/angular_fr_FR.xml
Normal file
2891
client/src/locale/target/angular_fr_FR.xml
Normal file
File diff suppressed because it is too large
Load diff
|
@ -2,11 +2,12 @@ export const LOCALE_FILES = [ 'player', 'server' ]
|
||||||
|
|
||||||
export const I18N_LOCALES = {
|
export const I18N_LOCALES = {
|
||||||
'en-US': 'English (US)',
|
'en-US': 'English (US)',
|
||||||
fr: 'French'
|
'fr-FR': 'French (France)'
|
||||||
}
|
}
|
||||||
|
|
||||||
const I18N_LOCALE_ALIAS = {
|
const I18N_LOCALE_ALIAS = {
|
||||||
'en': 'en-US'
|
'en': 'en-US',
|
||||||
|
'fr': 'fr-FR'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES)
|
export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES)
|
||||||
|
@ -38,6 +39,12 @@ export function getCompleteLocale (locale: string) {
|
||||||
return locale
|
return locale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getShortLocale (locale: string) {
|
||||||
|
if (locale.indexOf('-') === -1) return locale
|
||||||
|
|
||||||
|
return locale.split('-')[0]
|
||||||
|
}
|
||||||
|
|
||||||
export function buildFileLocale (locale: string) {
|
export function buildFileLocale (locale: string) {
|
||||||
const completeLocale = getCompleteLocale(locale)
|
const completeLocale = getCompleteLocale(locale)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue