-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add support for central translation repository #1269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 5 commits
ed4af25
58feff7
946ff37
ac219be
78721fb
c37c5b8
9d63b62
921cb9c
7a2825d
eefdb8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| import is from './is'; | ||
| import { getDeep } from './objects'; | ||
| import { replaceAll } from './strings'; | ||
| import languages from '../../locales'; | ||
|
|
||
| // Skip i18n for abbreviations and brand names | ||
| const resources = { | ||
|
|
@@ -21,6 +22,15 @@ const i18n = { | |
| return ''; | ||
| } | ||
|
|
||
| const english = languages.filter(e => e.code === 'en'); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From #1269 (review):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Default language should be But maybe there could be support to change fallback language. |
||
| const locale = languages.filter(e => !is.empty(config.language) && e.code === config.language); | ||
|
|
||
| if (!is.empty(locale)) { | ||
| config.i18n = Object.assign({}, english[0].i18n, locale[0].i18n, config.i18n); | ||
| } else { | ||
| config.i18n = Object.assign({}, english[0].i18n, config.i18n); | ||
| } | ||
|
|
||
| let string = getDeep(config.i18n, key); | ||
|
|
||
| if (is.empty(string)) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // ========================================================================== | ||
| // Plyr English translation | ||
| // ========================================================================== | ||
|
|
||
| const i18n = { | ||
| restart: 'Restart', | ||
| rewind: 'Rewind {seektime}s', | ||
| play: 'Play', | ||
| pause: 'Pause', | ||
| fastForward: 'Forward {seektime}s', | ||
| seek: 'Seek', | ||
| seekLabel: '{currentTime} of {duration}', | ||
| played: 'Played', | ||
| buffered: 'Buffered', | ||
| currentTime: 'Current time', | ||
| duration: 'Duration', | ||
| volume: 'Volume', | ||
| mute: 'Mute', | ||
| unmute: 'Unmute', | ||
| enableCaptions: 'Enable captions', | ||
| disableCaptions: 'Disable captions', | ||
| download: 'Download', | ||
| enterFullscreen: 'Enter fullscreen', | ||
| exitFullscreen: 'Exit fullscreen', | ||
| frameTitle: 'Player for {title}', | ||
| captions: 'Captions', | ||
| settings: 'Settings', | ||
| menuBack: 'Go back to previous menu', | ||
| speed: 'Speed', | ||
| normal: 'Normal', | ||
| quality: 'Quality', | ||
| loop: 'Loop', | ||
| start: 'Start', | ||
| end: 'End', | ||
| all: 'All', | ||
| reset: 'Reset', | ||
| disabled: 'Disabled', | ||
| enabled: 'Enabled', | ||
| advertisement: 'Ad', | ||
| qualityBadge: { | ||
| '480': 'SD', | ||
| '576': 'SD', | ||
| '720': 'HD', | ||
| '1080': 'HD', | ||
| '1440': 'HD', | ||
| '2160': '4K', | ||
| }, | ||
| }; | ||
|
|
||
| export default i18n; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // ========================================================================== | ||
| // Plyr supported languages | ||
| // ========================================================================== | ||
|
|
||
| import en from './en'; | ||
| import sl from './sl'; | ||
|
|
||
| const languages = [ | ||
| { code: 'en', name: 'English', i18n: en }, | ||
| { code: 'sl', name: 'Slovenščina', i18n: sl }, | ||
| ]; | ||
|
|
||
| export default languages; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // ========================================================================== | ||
| // Plyr Slovenian translation | ||
| // ========================================================================== | ||
|
|
||
| const i18n = { | ||
| restart: 'Ponovno predvajaj', | ||
| rewind: 'Nazaj za {seektime} sekund', | ||
| play: 'Predvajaj', | ||
| pause: 'Zaustavi', | ||
| fastForward: 'Naprej za {seektime} sekund', | ||
| seek: 'Pojdi', | ||
| seekLabel: '{currentTime} od {duration}', | ||
| played: 'Predvajano', | ||
| buffered: 'Predpomnjeno', | ||
| currentTime: 'Čas', | ||
| duration: 'Dolžina', | ||
| volume: 'Glasnost', | ||
| mute: 'Izklopi zvok', | ||
| unmute: 'Vklopi zvok', | ||
| enableCaptions: 'Omogoči podnapise', | ||
| disableCaptions: 'Onemogoči podnapise', | ||
| download: 'Prenesi', | ||
| enterFullscreen: 'Odpri celozaslonski način', | ||
| exitFullscreen: 'Zapri celozaslonski način', | ||
| frameTitle: 'Predvajalnik za {title}', | ||
| captions: 'Podnapisi', | ||
| settings: 'Nastavitve', | ||
| menuBack: 'Pojdi nazaj v prejšnji meni', | ||
| speed: 'Hitrost', | ||
| normal: 'Običajna', | ||
| quality: 'Kakovost', | ||
| loop: 'Zanka', | ||
| start: 'Začetek', | ||
| end: 'Konec', | ||
| all: 'Vse', | ||
| reset: 'Ponastavi', | ||
| disabled: 'Onemogočeni', | ||
| enabled: 'Omogočeni', | ||
| advertisement: 'Oglas', | ||
| qualityBadge: { | ||
| '480': 'SD', | ||
| '576': 'SD', | ||
| '720': 'HD', | ||
| '1080': 'HD', | ||
| '1440': 'HD', | ||
| '2160': '4K', | ||
| }, | ||
| }; | ||
|
|
||
| export default i18n; | ||
|
|
Uh oh!
There was an error while loading. Please reload this page.