mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-04-28 23:41:18 +00:00
Localization framework
This commit is contained in:
@@ -5,6 +5,7 @@ import IconButton from 'Components/Link/IconButton';
|
||||
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
||||
import TableRowCell from 'Components/Table/Cells/TableRowCell';
|
||||
import { icons, kinds } from 'Helpers/Props';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import styles from './BookFileActionsCell.css';
|
||||
|
||||
class BookFileActionsCell extends Component {
|
||||
@@ -86,9 +87,9 @@ class BookFileActionsCell extends Component {
|
||||
<ConfirmModal
|
||||
isOpen={isConfirmDeleteModalOpen}
|
||||
kind={kinds.DANGER}
|
||||
title="Delete Book File"
|
||||
message={`Are you sure you want to delete ${path}?`}
|
||||
confirmLabel="Delete"
|
||||
title={translate('DeleteBookFile')}
|
||||
message={translate('DeleteBookFileMessageText', [path])}
|
||||
confirmLabel={translate('Delete')}
|
||||
onConfirm={this.onConfirmDelete}
|
||||
onCancel={this.onConfirmDeleteModalClose}
|
||||
/>
|
||||
|
||||
@@ -9,6 +9,7 @@ import Table from 'Components/Table/Table';
|
||||
import TableBody from 'Components/Table/TableBody';
|
||||
import { kinds } from 'Helpers/Props';
|
||||
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
||||
import removeOldSelectedState from 'Utilities/Table/removeOldSelectedState';
|
||||
import selectAll from 'Utilities/Table/selectAll';
|
||||
@@ -218,9 +219,9 @@ class BookFileEditorTableContent extends Component {
|
||||
<ConfirmModal
|
||||
isOpen={isConfirmDeleteModalOpen}
|
||||
kind={kinds.DANGER}
|
||||
title="Delete Selected Book Files"
|
||||
message={'Are you sure you want to delete the selected book files?'}
|
||||
confirmLabel="Delete"
|
||||
title={translate('DeleteSelectedBookFiles')}
|
||||
message={translate('DeleteSelectedBookFilesMessageText')}
|
||||
confirmLabel={translate('Delete')}
|
||||
onConfirm={this.onConfirmDelete}
|
||||
onCancel={this.onConfirmDeleteModalClose}
|
||||
/>
|
||||
|
||||
@@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import Icon from 'Components/Icon';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import FileDetails from './FileDetails';
|
||||
import styles from './ExpandingFileDetails.css';
|
||||
|
||||
@@ -55,7 +56,7 @@ class ExpandingFileDetails extends Component {
|
||||
<Icon
|
||||
className={styles.expandButtonIcon}
|
||||
name={isExpanded ? icons.COLLAPSE : icons.EXPAND}
|
||||
title={isExpanded ? 'Hide file info' : 'Show file info'}
|
||||
title={isExpanded ? translate('IsExpandedHideFileInfo') : translate('IsExpandedShowFileInfo')}
|
||||
size={24}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ import DescriptionListItemDescription from 'Components/DescriptionList/Descripti
|
||||
import DescriptionListItemTitle from 'Components/DescriptionList/DescriptionListItemTitle';
|
||||
import Link from 'Components/Link/Link';
|
||||
import stripHtml from 'Utilities/String/stripHtml';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import styles from './FileDetails.css';
|
||||
|
||||
function renderRejections(rejections) {
|
||||
@@ -43,7 +44,7 @@ function FileDetails(props) {
|
||||
{
|
||||
filename &&
|
||||
<DescriptionListItem
|
||||
title="Filename"
|
||||
title={translate('Filename')}
|
||||
data={filename}
|
||||
descriptionClassName={styles.filename}
|
||||
/>
|
||||
@@ -51,119 +52,119 @@ function FileDetails(props) {
|
||||
{
|
||||
audioTags.title !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Track Title"
|
||||
title={translate('TrackTitle')}
|
||||
data={audioTags.title}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.trackNumbers[0] > 0 &&
|
||||
<DescriptionListItem
|
||||
title="Track Number"
|
||||
title={translate('TrackNumber')}
|
||||
data={audioTags.trackNumbers[0]}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.discNumber > 0 &&
|
||||
<DescriptionListItem
|
||||
title="Disc Number"
|
||||
title={translate('DiscNumber')}
|
||||
data={audioTags.discNumber}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.discCount > 0 &&
|
||||
<DescriptionListItem
|
||||
title="Disc Count"
|
||||
title={translate('DiscCount')}
|
||||
data={audioTags.discCount}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.bookTitle !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Book"
|
||||
title={translate('Book')}
|
||||
data={audioTags.bookTitle}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.authorTitle !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Author"
|
||||
title={translate('Author')}
|
||||
data={audioTags.authorTitle}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.seriesTitle !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Series"
|
||||
title={translate('Series')}
|
||||
data={audioTags.seriesTitle}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.seriesIndex !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Series Number"
|
||||
title={translate('SeriesNumber')}
|
||||
data={audioTags.seriesIndex}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.country !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Country"
|
||||
title={translate('Country')}
|
||||
data={audioTags.country.name}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.language !== undefined && audioTags.language !== 'UND' &&
|
||||
<DescriptionListItem
|
||||
title="Language"
|
||||
title={translate('Language')}
|
||||
data={audioTags.language}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.year > 0 &&
|
||||
<DescriptionListItem
|
||||
title="Year"
|
||||
title={translate('Year')}
|
||||
data={audioTags.year}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.label !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Label"
|
||||
title={translate('Label')}
|
||||
data={audioTags.label}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.publisher !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Publisher"
|
||||
title={translate('Publisher')}
|
||||
data={audioTags.publisher}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.catalogNumber !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Catalog Number"
|
||||
title={translate('CatalogNumber')}
|
||||
data={audioTags.catalogNumber}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.disambiguation !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="Overview"
|
||||
title={translate('Overview')}
|
||||
data={stripHtml(audioTags.disambiguation)}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.isbn !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="ISBN"
|
||||
title={translate('ISBN')}
|
||||
data={audioTags.isbn}
|
||||
/>
|
||||
}
|
||||
{
|
||||
audioTags.asin !== undefined &&
|
||||
<DescriptionListItem
|
||||
title="ASIN"
|
||||
title={translate('ASIN')}
|
||||
data={audioTags.asin}
|
||||
/>
|
||||
} {
|
||||
@@ -172,7 +173,7 @@ function FileDetails(props) {
|
||||
to={`https://musicbrainz.org/author/${audioTags.authorMBId}`}
|
||||
>
|
||||
<DescriptionListItem
|
||||
title="MusicBrainz Author ID"
|
||||
title={translate('MusicBrainzAuthorID')}
|
||||
data={audioTags.authorMBId}
|
||||
/>
|
||||
</Link>
|
||||
@@ -183,7 +184,7 @@ function FileDetails(props) {
|
||||
to={`https://musicbrainz.org/release-group/${audioTags.bookMBId}`}
|
||||
>
|
||||
<DescriptionListItem
|
||||
title="MusicBrainz Book ID"
|
||||
title={translate('MusicBrainzBookID')}
|
||||
data={audioTags.bookMBId}
|
||||
/>
|
||||
</Link>
|
||||
@@ -194,7 +195,7 @@ function FileDetails(props) {
|
||||
to={`https://musicbrainz.org/release/${audioTags.releaseMBId}`}
|
||||
>
|
||||
<DescriptionListItem
|
||||
title="MusicBrainz Release ID"
|
||||
title={translate('MusicBrainzReleaseID')}
|
||||
data={audioTags.releaseMBId}
|
||||
/>
|
||||
</Link>
|
||||
@@ -205,7 +206,7 @@ function FileDetails(props) {
|
||||
to={`https://musicbrainz.org/recording/${audioTags.recordingMBId}`}
|
||||
>
|
||||
<DescriptionListItem
|
||||
title="MusicBrainz Recording ID"
|
||||
title={translate('MusicBrainzRecordingID')}
|
||||
data={audioTags.recordingMBId}
|
||||
/>
|
||||
</Link>
|
||||
@@ -216,7 +217,7 @@ function FileDetails(props) {
|
||||
to={`https://musicbrainz.org/track/${audioTags.trackMBId}`}
|
||||
>
|
||||
<DescriptionListItem
|
||||
title="MusicBrainz Track ID"
|
||||
title={translate('MusicBrainzTrackID')}
|
||||
data={audioTags.trackMBId}
|
||||
/>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user