Final components done, dynamic language selector

This commit is contained in:
James Barnsley
2020-07-23 21:07:08 +12:00
parent efed79e801
commit 2a0e088b71
45 changed files with 1186 additions and 645 deletions

View File

@ -1,7 +1 @@
sidebar:
now_playing: Läuft gerade
settings: Einstellungen
now_playing:
title: Läuft gerade
settings:
title: Einstellungen
name: Deutsch

View File

@ -2,15 +2,25 @@ import { merge } from 'lodash';
import en from './en.yaml';
import _de from './de.yaml';
// Merge languages with English. This provides English fallbacks to untranslated
// fields without breaking the UI (with blanks)
const de = {};
merge(de, en, _de);
const available = [
{ key: 'en', name: en.name },
{ key: 'de', name: de.name },
];
export default {
en,
de,
available,
};
export {
en,
de,
available,
};

View File

@ -1,3 +1,8 @@
name: English
##
# Common and reusable phrases
##
errors:
uri_not_found: 'Could not find anything with URI %{uri}'
could_not_load: Could not load
@ -5,21 +10,19 @@ errors:
authorization_required: 'You must authorize %{provider} first'
enable_first: 'Enable %{provider} first'
no_service_worker: Service worker not supported
specs:
tracks: '%{count} tracks'
followers: '%{count} followers'
listeners: '%{count} listeners'
playlists: '%{count} playlists'
plays: '%{count} plays'
popularity: '%{percent}% popularity'
edited: 'Edited '
required: Required
unknown_error: Unknown error
need_to_be_online: You need to be online load this resource
actions:
play: Play
play_all: Play all
play_next: Play next
pause: Pause
stop: Stop
add_to_playlist: Add to playlist
add_to_library: Add to library
remove_from_library: Remove from library
add_to_queue: Add to queue
reset: Reset
back: Back
refresh: Refresh
@ -27,10 +30,12 @@ actions:
disable: Disable
send: Send
save: Save
start: Start
edit: Edit
add: Add
confirm: Are you sure?
delete: Delete
remove: Remove
common:
popularity: Popularity
name: Name
@ -41,6 +46,25 @@ common:
sort: Sort
filter: Filter
by: ' by '
fields:
start_typing: 'Start typing...'
search: 'Search...'
sort: Sort
view: View
source: Source
uri: URI(s)
filters:
all: All
thumbnails: Thumbnails
list: List
as_loaded: As loaded
name: Name
artist: Artist
updated: Updated
tracks: Tracks
source: Source
editable: Editable
owner: Owner
time:
seconds:
short: secs
@ -66,6 +90,18 @@ time:
short: yrs
singular: year
plural: years
specs:
tracks: '%{count} tracks'
followers: '%{count} followers'
listeners: '%{count} listeners'
playlists: '%{count} playlists'
plays: '%{count} plays'
popularity: '%{percent}% popularity'
added: 'Added '
added_ago: 'Added %{time} ago'
edited: 'Edited '
edited_ago: 'Edited %{time} ago'
played_ago: 'Played %{time} ago'
services:
mopidy:
title: Mopidy
@ -79,12 +115,19 @@ services:
genius:
title: Genius
switch_lyrics_result: Switch to another lyrics seach result
want_lyrics: 'Want track lyrics? Authorize Genius in '
google:
title: Google
icecast:
title: Icecast
lastfm:
title: LastFM
love: Love
unlove: Unlove
##
# Components
##
sidebar:
now_playing: Now playing
search: Search
@ -100,6 +143,53 @@ sidebar:
browse: Browse
settings: Settings
not_connected: '%{name} not connected'
browser_offline: Browser offline
update_available: Update available
context_menu:
add_to_playlist:
title: Add to playlist
no_playlists: No writable playlists
shuffle_play: Shuffle play
play_next: Play next
play_top_tracks: Play top tracks
love_track: Love track
unlove_track: Unlove track
go_to_artist: Go to artist
go_to_user: Go to user
track_info: Track info
discover_similar: Discover similar
start_radio: Start radio
copy_uri: Copy URI(s)
dropzones:
dragging_things: 'Dragging %{count} things'
playback_controls:
consume: Consume
shuffle: Shuffle
repeat: Repeat
no_outputs: No outputs
snapcast:
enabled: Enabled
show_disconnected_clients: Show disconnected clients
no_connected_clients: No connected clients
host: Host
port: Port
name: Name
name_disconnected: Name (disconnected)
group: Group
new_group: '+ New group'
latency: Latency
stream: Stream
volume: Volume
authentication:
popup_blocked: Popup blocked. Please allow popups and try again.
failed: Authorization failed. %{origin} is not the configured authorization_url.
log_out: Log out
log_in: Log in
##
# Views
##
now_playing:
title: Now playing
context_actions:
@ -162,12 +252,14 @@ playlist:
queue_history:
title: Playback history
search:
title: 'Search'
title: Search
title_window: 'Search: %{term}'
context_actions:
sort: Sort
source: 'Sources (%{count})'
placeholder: Search
all:
title: All
artists:
title: Artists
more: 'All artists (%{count})'
@ -196,8 +288,6 @@ settings:
username:
label: Username
description: A non-unique string used to identify this client (no special characters)
services:
title: Services
interface:
title: Interface
language:
@ -223,8 +313,9 @@ settings:
reporting:
label: Reporting
sublabel: Allow reporting of anonymous usage statistics
description: 'This helps identify errors and potential features that make Iris better for everyone. See '
description: 'This anonymous usage data is important in identifying errors and potential features that make Iris better for everyone. Want to know more? Read the '
privacy_policy: privacy policy
are_you_sure: Are you sure you don't want to support this?
commands:
label: Commands
advanced:
@ -253,11 +344,60 @@ settings:
blurb_2: '. It is provided free and with absolutely no warranty. If you paid someone for this software, please let me know.'
donate: Donate
github: GitHub
pusher_connection_list:
not_connected: Not connected
no_connections: No connections
you: ' (you)'
servers:
inactive: Inactive
connecting: Connecting
disconnected: Disconnected
connected: Connected
new_server: New server
name: Name
host: Host
port: Port
encryption:
label: Encryption
sublabel: Use SSL
description: Requires a SSL proxy
switch: Switch to this server
reconnect: Reconnect
services:
title: Services
limited_access: Limited access
unknown: Unknown
current_user: Current user
authorization: Authorization
refresh_token: Refresh token
authorized: Authorized
read_only: Read-only
unauthorized: Unauthorized
enabled: Enabled
disabled: Disabled
connected: Connected
disconnected: Disconnected
spotify:
mopidy_spotify_not_running: Mopidy-Spotify extension is not running - you will not be able to play any Spotify tracks
country:
label: Country
description: An ISO 3166-1 alpha-2 country code (eg 'NZ')
locale:
title: Locale
description: Lowercase ISO 639 language code and an uppercase ISO 3166-1 alpha-2 country code, joined by an underscore (eg 'en_NZ')
icecast:
enable:
label: Enable
description: Stream audio to this browser
location:
label: Location
description: The full URL to your stream endpoint
user:
title: User
title_window: '%{name} (user)'
you: You
discover:
title: Discover
categories:
title: 'Genre / Mood'
category:
@ -289,24 +429,6 @@ library:
title: My playlists
tracks:
title: My tracks
fields:
add_seed_field:
placeholder: 'Start typing...'
sort: Sort
view: View
source: Source
filters:
all: All
thumbnails: Thumbnails
list: List
as_loaded: As loaded
name: Name
artist: Artist
updated: Updated
tracks: Tracks
source: Source
editable: Editable
owner: Owner
modal:
add_to_playlist:
title: Add to playlist
@ -348,4 +470,36 @@ modal:
get: GET
post: POST
data: Data
headers: Additional headers
headers: Additional headers
edit_radio:
title: Radio
subtitle: Add and remove seeds to shape the sound of your radio. Radio uses Spotify's recommendations engine to suggest tracks similar to your seeds.
invalid_seed_uri: Invalid seed URI(s)
too_many_seeds: More than 5 seeds provided, ignoring rest
only_spotify_uris: Only Spotify URIs are supported
already_added: URI already added
no_seeds: No seeds
initial_setup:
title: Welcome to Iris
username: User
kiosk:
title: Now playing
title_window: '%{name} by %{artist} (now playing)'
lyrics: Lyrics
share_configuration:
title: Share configuration
subtitle: Push your authorizations and interface settings to another, connected user
no_peers: No peer connections
recipients: Recipients
configurations: Configurations
authorization: '%{service} authorization'
logged_in_as: 'Logged in as %{name}'
snapcast_description: Server connection details
interface: Interface settings
interface_description: Theme, sorting, filters, etc
import:
title: Configuration shared
subtitle: 'Another user has shared their configuration with you. This includes:'
do_you_want_to_import: Do you want to import this?
import_now: Import now
successful: Import successful

View File

@ -5,6 +5,7 @@ import { titleCase } from '../util/helpers';
const PARAMS_REG_EXP = '%{(.*?)}';
const paramsRegExp = new RegExp(PARAMS_REG_EXP, 'g');
const languagesAvailable = dictionaries.available;
const i18n = (path, params = {}, transform) => {
const dictionary = dictionaries[window.language || 'en'] || dictionaries.en;
@ -49,9 +50,11 @@ const I18n = ({
export default {
I18n,
i18n,
languagesAvailable,
};
export {
I18n,
i18n,
languagesAvailable,
};