diff --git a/packages/app/app/App.js b/packages/app/app/App.js index 104b78068f..dcec6e7fee 100644 --- a/packages/app/app/App.js +++ b/packages/app/app/App.js @@ -4,12 +4,12 @@ import { Icon } from 'semantic-ui-react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { NavLink, withRouter } from 'react-router-dom'; + import classnames from 'classnames'; import _ from 'lodash'; import Sound from 'react-hifi'; import { withTranslation } from 'react-i18next'; import { PluginConfig } from '@nuclear/core'; - import * as SearchActions from './actions/search'; import * as PlayerActions from './actions/player'; import * as PlaylistsActions from './actions/playlists'; @@ -157,7 +157,7 @@ class App extends React.PureComponent { src={this.props.settings.compactMenuBar ? logoIcon : logoImg} />
- {this.props.settings.compactMenuBar ? '0.6.17' : 'Version 0.6.17'} + {this.props.settings.compactMenuBar ? '0.6.17' : this.props.t('version') + ' 0.6.17'}
diff --git a/packages/app/app/components/Downloads/DownloadsHeader/index.js b/packages/app/app/components/Downloads/DownloadsHeader/index.js index 27bf4b6cf0..8568f3c235 100644 --- a/packages/app/app/components/Downloads/DownloadsHeader/index.js +++ b/packages/app/app/components/Downloads/DownloadsHeader/index.js @@ -19,7 +19,8 @@ const DownloadsHeader = ({ }) => ( - Saving in: + {/* change */} + {t('saving-in')} { _.isEmpty(directory) ? remote.app.getPath('downloads') : directory} diff --git a/packages/app/app/components/EqualizerPresetList/index.js b/packages/app/app/components/EqualizerPresetList/index.js index c7ea1e1713..368d1bbda4 100644 --- a/packages/app/app/components/EqualizerPresetList/index.js +++ b/packages/app/app/components/EqualizerPresetList/index.js @@ -2,35 +2,38 @@ import React from 'react'; import PropTypes from 'prop-types'; import { List, Icon } from 'semantic-ui-react'; import classNames from 'classnames'; +import { useTranslation } from 'react-i18next'; import styles from './styles.scss'; -const EqualizerPresetList = ({ presets, onClickItem, selected }) => ( -
-

Presets

- - {presets.map((preset, index) => ( - preset !== selected && onClickItem(preset.id)} - className={ - classNames( - styles.equalizer_item, - { - [styles.equalizer_click_item]: preset.id !== selected - }) - } - > - - {preset.id === selected && } - - {preset.label} - - ))} - -
-); - +const EqualizerPresetList = ({ presets, onClickItem, selected }) => { + const { t } = useTranslation('equalizer'); + return ( +
+

{t('presets')}

+ + {presets.map((preset, index) => ( + preset !== selected && onClickItem(preset.id)} + className={ + classNames( + styles.equalizer_item, + { + [styles.equalizer_click_item]: preset.id !== selected + }) + } + > + + {preset.id === selected && } + + {t(preset.label)} + + ))} + +
+ ); +}; EqualizerPresetList.propTypes = { presets: PropTypes.array.isRequired, onClickItem: PropTypes.func, diff --git a/packages/app/app/components/HelpModal/index.tsx b/packages/app/app/components/HelpModal/index.tsx index 9abfeb8245..3ef410450e 100644 --- a/packages/app/app/components/HelpModal/index.tsx +++ b/packages/app/app/components/HelpModal/index.tsx @@ -111,7 +111,7 @@ const HelpModal: React.FC = ({
- Our top 10 Contributors + {t('contributors')}
this.renderAllResultsPane() }, artistsHasResults && { - menuItem: 'Artists', + menuItem: this.props.t('artist_plural'), render: () => this.renderPane( this.props.artistSearchResults, @@ -123,7 +123,7 @@ class SearchResults extends React.Component { ) }, albumsHasResults && { - menuItem: 'Albums', + menuItem: this.props.t('album_plural'), render: () => this.renderPane( this.props.albumSearchResults, @@ -131,19 +131,19 @@ class SearchResults extends React.Component { ) }, tracksHasResults && { - menuItem: 'Tracks', + menuItem: this.props.t('track_plural'), render: () => this.renderTrackListPane(this.props.trackSearchResults.info) }, playlistsHasResults && { - menuItem: 'Playlist', + menuItem: this.props.t('playlist'), render: () => this.renderPlaylistPane() }, liveStreamsHasResults && { - menuItem: 'LiveStream', + menuItem: this.props.t('live-stream'), render: () => this.renderTrackListPane(this.props.liveStreamSearchResults.info) }, podcastsHasResults && { - menuItem: 'Podcast', + menuItem: this.props.t('podcast'), render: () => this.renderPane( this.props.podcastSearchResults, diff --git a/packages/app/app/components/Settings/index.tsx b/packages/app/app/components/Settings/index.tsx index f38816faca..89fa56d657 100644 --- a/packages/app/app/components/Settings/index.tsx +++ b/packages/app/app/components/Settings/index.tsx @@ -138,7 +138,7 @@ const Settings: React.FC = ({ const renderSliderOption = (option) => (
- + = ({ width='auto' onChange={(e) => handleSliderChange(e, option)} thumbSize={21} /> - +
); diff --git a/packages/app/app/containers/EqualizerViewContainer/index.js b/packages/app/app/containers/EqualizerViewContainer/index.js index e7f7ac81bc..cb664aba79 100644 --- a/packages/app/app/containers/EqualizerViewContainer/index.js +++ b/packages/app/app/containers/EqualizerViewContainer/index.js @@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux'; import * as EqualizerActions from '../../actions/equalizer'; import Equalizer from '../../components/Equalizer'; import EqualizerPresetList from '../../components/EqualizerPresetList'; +import { useTranslation } from 'react-i18next'; import styles from './styles.scss'; @@ -22,9 +23,10 @@ const EqualizerViewContainer = () => { const dispatch = useDispatch(); const actions = useMemo(() => bindActionCreators(EqualizerActions, dispatch), [dispatch]); const presets = usePresets(); + const { t } = useTranslation('app'); return (
-

Equalizer

+

{t('equalizer')}

{ + beforeAll(() => { + setupI18Next(); + }); it('should render settings', () => { const { component } = mountComponent(); expect(component.asFragment()).toMatchSnapshot(); diff --git a/packages/app/app/containers/SettingsContainer/__snapshots__/SettingsContainer.test.tsx.snap b/packages/app/app/containers/SettingsContainer/__snapshots__/SettingsContainer.test.tsx.snap index a85ea4a5ae..6589fc1652 100644 --- a/packages/app/app/containers/SettingsContainer/__snapshots__/SettingsContainer.test.tsx.snap +++ b/packages/app/app/containers/SettingsContainer/__snapshots__/SettingsContainer.test.tsx.snap @@ -14,7 +14,7 @@ exports[`Settings view container should render settings 1`] = `
- social + Social

- lastfm-title + Last.fm

- lastfm-description + In order to enable scrobbling, you first have to connect and authorize Nuclear on Last.fm, then click log in.

@@ -60,9 +60,9 @@ exports[`Settings view container should render settings 1`] = ` class="settings_social_item" > - user + User: - notlogged + Not logged in
- lastfm-connect + Connect with Last.fm
- fmfav-msg + Import your Last.fm Favorites
- fmfav-btn + Import
@@ -142,16 +142,7 @@ exports[`Settings view container should render settings 1`] = ` test-file-stub - - mastodon-title - -
-
-

- mastodon-description -

+
@@ -164,7 +155,7 @@ exports[`Settings view container should render settings 1`] = `
- mastodon-authorize + Authorize
@@ -192,7 +183,7 @@ exports[`Settings view container should render settings 1`] = `
- http + HTTP API

+ />
- enable-api + Enable the api
- api-port + Port used by the api
- playback + Playback

- loop-after-queue-end + Loop after playing the last queue item
- shuffle-queue + Shuffle songs
- shuffle-when-going-back + Shuffle on previous track

- shuffle-when-going-back-description + Play a random track when shuffle is active and the previous track button is clicked

- autoradio + Autoradio

- autoradio-description + Add similar tracks automatically when the queue is ending

- seek-iteration + Number of seconds to seek forward/backwards when pressing arrow keys
- autoradio-craziness + Autoradio craziness

- autoradio-craziness-description + Autoradio will select songs that are less similar to the ones already in the queue the crazier it is

- skip-sponsorblock + Skip non-music segment

- skip-sponsorblock-description + Playback skips non-music segment from SponsorBlock (https://sponsor.ajay.app/)

- program-settings + Program settings

- notification-timeout + Notification timeout
- disable-gpu + Disable hardware rendering (might fix issues with dragging elements and flashing screen)
- frameless-window + Frameless window (requires restart)
- language + Language