Fixed: Missing Translates

This commit is contained in:
Bakerboy448
2023-04-29 14:43:13 -05:00
committed by Qstick
parent a0e2f3324c
commit 40dc4de47d
9 changed files with 84 additions and 43 deletions

View File

@@ -6,6 +6,7 @@ import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import { icons } from 'Helpers/Props';
import CapabilitiesLabel from 'Indexer/Index/Table/CapabilitiesLabel';
import translate from 'Utilities/String/translate';
import HistoryDetailsModal from './Details/HistoryDetailsModal';
import HistoryEventTypeCell from './HistoryEventTypeCell';
import HistoryRowParameter from './HistoryRowParameter';
@@ -193,7 +194,7 @@ class HistoryRow extends Component {
{
data.season ?
<HistoryRowParameter
title='Season'
title={translate('Season')}
value={data.season}
/> :
null
@@ -202,7 +203,7 @@ class HistoryRow extends Component {
{
data.episode ?
<HistoryRowParameter
title='Episode'
title={translate('Episode')}
value={data.episode}
/> :
null
@@ -211,7 +212,7 @@ class HistoryRow extends Component {
{
data.artist ?
<HistoryRowParameter
title='Artist'
title={translate('Artist')}
value={data.artist}
/> :
null
@@ -220,7 +221,7 @@ class HistoryRow extends Component {
{
data.album ?
<HistoryRowParameter
title='Album'
title={translate('Album')}
value={data.album}
/> :
null
@@ -229,7 +230,7 @@ class HistoryRow extends Component {
{
data.label ?
<HistoryRowParameter
title='Label'
title={translate('Label')}
value={data.label}
/> :
null
@@ -238,7 +239,7 @@ class HistoryRow extends Component {
{
data.track ?
<HistoryRowParameter
title='Track'
title={translate('Track')}
value={data.track}
/> :
null
@@ -247,7 +248,7 @@ class HistoryRow extends Component {
{
data.year ?
<HistoryRowParameter
title='Year'
title={translate('Year')}
value={data.year}
/> :
null
@@ -256,7 +257,7 @@ class HistoryRow extends Component {
{
data.genre ?
<HistoryRowParameter
title='Genre'
title={translate('Genre')}
value={data.genre}
/> :
null
@@ -265,7 +266,7 @@ class HistoryRow extends Component {
{
data.author ?
<HistoryRowParameter
title='Author'
title={translate('Author')}
value={data.author}
/> :
null
@@ -274,7 +275,7 @@ class HistoryRow extends Component {
{
data.bookTitle ?
<HistoryRowParameter
title='Book'
title={translate('Book')}
value={data.bookTitle}
/> :
null
@@ -283,7 +284,7 @@ class HistoryRow extends Component {
{
data.publisher ?
<HistoryRowParameter
title='Publisher'
title={translate('Publisher')}
value={data.publisher}
/> :
null
@@ -381,14 +382,14 @@ class HistoryRow extends Component {
<IconButton
name={icons.SEARCH}
onPress={this.onSearchPress}
title='Repeat Search'
title={translate('RepeatSearch')}
/> :
null
}
<IconButton
name={icons.INFO}
onPress={this.onDetailsPress}
title='History Details'
title={translate('HistoryDetails')}
/>
</TableRowCell>
);

View File

@@ -222,7 +222,11 @@ const IndexerIndex = withScrollPosition((props: IndexerIndexProps) => {
<PageToolbarSeparator />
<IndexerIndexSelectModeButton
label={isSelectMode ? 'Stop Selecting' : 'Select Indexer'}
label={
isSelectMode
? translate('StopSelecting')
: translate('SelectIndexer')
}
iconName={isSelectMode ? icons.SERIES_ENDED : icons.CHECK}
isSelectMode={isSelectMode}
overflowComponent={IndexerIndexSelectModeMenuItem}
@@ -230,7 +234,7 @@ const IndexerIndex = withScrollPosition((props: IndexerIndexProps) => {
/>
<IndexerIndexSelectAllButton
label="SelectAll"
label={translate('SelectAll')}
isSelectMode={isSelectMode}
overflowComponent={IndexerIndexSelectAllMenuItem}
/>
@@ -245,7 +249,10 @@ const IndexerIndex = withScrollPosition((props: IndexerIndexProps) => {
optionsComponent={IndexerIndexTableOptions}
onTableOptionChange={onTableOptionChange}
>
<PageToolbarButton label="Options" iconName={icons.TABLE} />
<PageToolbarButton
label={translate('Options')}
iconName={icons.TABLE}
/>
</TableOptionsModalWrapper>
<PageToolbarSeparator />
@@ -276,7 +283,9 @@ const IndexerIndex = withScrollPosition((props: IndexerIndexProps) => {
>
{isFetching && !isPopulated ? <LoadingIndicator /> : null}
{!isFetching && !!error ? <div>Unable to load indexers</div> : null}
{!isFetching && !!error ? (
<div>{translate('UnableToLoadIndexers')}</div>
) : null}
{isLoaded ? (
<div className={styles.contentBodyContainer}>

View File

@@ -2,6 +2,7 @@ import React, { useCallback } from 'react';
import { SelectActionType, useSelect } from 'App/SelectContext';
import PageToolbarButton from 'Components/Page/Toolbar/PageToolbarButton';
import { icons } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
interface IndexerIndexSelectAllButtonProps {
label: string;
@@ -32,7 +33,7 @@ function IndexerIndexSelectAllButton(props: IndexerIndexSelectAllButtonProps) {
return isSelectMode ? (
<PageToolbarButton
label={allSelected ? 'Unselect All' : 'Select All'}
label={allSelected ? translate('UnselectAll') : translate('SelectAll')}
iconName={icon}
onPress={onPress}
/>

View File

@@ -2,6 +2,7 @@ import React, { useCallback } from 'react';
import { SelectActionType, useSelect } from 'App/SelectContext';
import PageToolbarOverflowMenuItem from 'Components/Page/Toolbar/PageToolbarOverflowMenuItem';
import { icons } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
interface IndexerIndexSelectAllMenuItemProps {
label: string;
@@ -33,7 +34,7 @@ function IndexerIndexSelectAllMenuItem(
return isSelectMode ? (
<PageToolbarOverflowMenuItem
label={allSelected ? 'Unselect All' : 'Select All'}
label={allSelected ? translate('UnselectAll') : translate('SelectAll')}
iconName={iconName}
onPress={onPressWrapper}
/>

View File

@@ -14,6 +14,7 @@ import ModalHeader from 'Components/Modal/ModalHeader';
import { inputTypes, kinds, sizes } from 'Helpers/Props';
import createAllIndexersSelector from 'Store/Selectors/createAllIndexersSelector';
import createTagsSelector from 'Store/Selectors/createTagsSelector';
import translate from 'Utilities/String/translate';
import styles from './TagsModalContent.css';
interface TagsModalContentProps {
@@ -70,7 +71,7 @@ function TagsModalContent(props: TagsModalContentProps) {
<ModalBody>
<Form>
<FormGroup>
<FormLabel>Tags</FormLabel>
<FormLabel>{translate('Tags')}</FormLabel>
<FormInputGroup
type={inputTypes.TAG}
@@ -81,7 +82,7 @@ function TagsModalContent(props: TagsModalContentProps) {
</FormGroup>
<FormGroup>
<FormLabel>Apply Tags</FormLabel>
<FormLabel>{translate('ApplyTags')}</FormLabel>
<FormInputGroup
type={inputTypes.SELECT}
@@ -89,17 +90,17 @@ function TagsModalContent(props: TagsModalContentProps) {
value={applyTags}
values={applyTagsOptions}
helpTexts={[
'How to apply tags to the selected series',
'Add: Add the tags the existing list of tags',
'Remove: Remove the entered tags',
'Replace: Replace the tags with the entered tags (enter no tags to clear all tags)',
translate('ApplyTagsHelpTexts1'),
translate('ApplyTagsHelpTexts2'),
translate('ApplyTagsHelpTexts3'),
translate('ApplyTagsHelpTexts4'),
]}
onChange={onApplyTagsChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>Result</FormLabel>
<FormLabel>{translate('Result')}</FormLabel>
<div className={styles.result}>
{indexerTags.map((id) => {
@@ -116,7 +117,11 @@ function TagsModalContent(props: TagsModalContentProps) {
return (
<Label
key={tag.id}
title={removeTag ? 'Removing tag' : 'Existing tag'}
title={
removeTag
? translate('RemoveTagRemovingTag')
: translate('RemoveTagExistingTag')
}
kind={removeTag ? kinds.INVERSE : kinds.INFO}
size={sizes.LARGE}
>
@@ -140,7 +145,7 @@ function TagsModalContent(props: TagsModalContentProps) {
return (
<Label
key={tag.id}
title={'Adding tag'}
title={translate('AddingTag')}
kind={kinds.SUCCESS}
size={sizes.LARGE}
>

View File

@@ -4,6 +4,7 @@ import FormGroup from 'Components/Form/FormGroup';
import FormInputGroup from 'Components/Form/FormInputGroup';
import FormLabel from 'Components/Form/FormLabel';
import { inputTypes } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import selectTableOptions from './selectTableOptions';
interface IndexerIndexTableOptionsProps {
@@ -32,13 +33,13 @@ function IndexerIndexTableOptions(props: IndexerIndexTableOptionsProps) {
return (
<Fragment>
<FormGroup>
<FormLabel>Show Search</FormLabel>
<FormLabel>{translate('ShowSearch')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="showSearchAction"
value={showSearchAction}
helpText="Show search button on hover"
helpText={translate('ShowSearchActionHelpText')}
onChange={onTableOptionChangeWrapper}
/>
</FormGroup>

View File

@@ -33,8 +33,8 @@ function IndexerStatusCell(props: IndexerStatusCellProps) {
const enableKind = redirect ? kinds.INFO : kinds.SUCCESS;
const enableIcon = redirect ? icons.REDIRECT : icons.CHECK;
const enableTitle = redirect
? 'Indexer is Enabled, Redirect is Enabled'
: 'Indexer is Enabled';
? translate('EnabledRedirected')
: translate('Enabled');
return (
<Component className={className} {...otherProps}>
@@ -43,7 +43,7 @@ function IndexerStatusCell(props: IndexerStatusCellProps) {
className={styles.statusIcon}
kind={enabled ? enableKind : kinds.DEFAULT}
name={enabled ? enableIcon : icons.BLOCKLIST}
title={enabled ? enableTitle : 'Indexer is Disabled'}
title={enabled ? enableTitle : translate('EnabledIndexerIsDisabled')}
/>
}
{status ? (

View File

@@ -10,6 +10,7 @@ import PageToolbar from 'Components/Page/Toolbar/PageToolbar';
import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
import { align, kinds } from 'Helpers/Props';
import getErrorMessage from 'Utilities/Object/getErrorMessage';
import translate from 'Utilities/String/translate';
import StatsFilterMenu from './StatsFilterMenu';
import styles from './Stats.css';
@@ -188,53 +189,53 @@ function Stats(props) {
<div className={styles.fullWidthChart}>
<BarChart
data={getAverageResponseTimeData(item.indexers)}
title='Average Response Times (ms)'
title={translate('AverageResponseTimesMs')}
/>
</div>
<div className={styles.fullWidthChart}>
<BarChart
data={getFailureRateData(item.indexers)}
title='Indexer Failure Rate'
title={translate('IndexerFailureRate')}
kind={kinds.WARNING}
/>
</div>
<div className={styles.halfWidthChart}>
<StackedBarChart
data={getTotalRequestsData(item.indexers)}
title='Total Indexer Queries'
title={translate('TotalIndexerQueries')}
/>
</div>
<div className={styles.halfWidthChart}>
<BarChart
data={getNumberGrabsData(item.indexers)}
title='Total Indexer Successful Grabs'
title={translate('TotalIndexerSuccessfulGrabs')}
/>
</div>
<div className={styles.halfWidthChart}>
<BarChart
data={getUserAgentQueryData(item.userAgents)}
title='Total User Agent Queries'
title={translate('TotalUserAgentQueries')}
horizontal={true}
/>
</div>
<div className={styles.halfWidthChart}>
<BarChart
data={getUserAgentGrabsData(item.userAgents)}
title='Total User Agent Grabs'
title={translate('TotalUserAgentGrabs')}
horizontal={true}
/>
</div>
<div className={styles.halfWidthChart}>
<DoughnutChart
data={getHostQueryData(item.hosts)}
title='Total Host Queries'
title={translate('TotalHostQueries')}
horizontal={true}
/>
</div>
<div className={styles.halfWidthChart}>
<DoughnutChart
data={getHostGrabsData(item.hosts)}
title='Total Host Grabs'
title={translate('TotalHostGrabs')}
horizontal={true}
/>
</div>