fix: fix the translations for watchlist permissions and userSettings page

This commit is contained in:
fallenbagel
2023-11-08 01:24:18 +05:00
parent 67bde68596
commit 8c82a61450
3 changed files with 37 additions and 9 deletions

View File

@@ -1,7 +1,9 @@
import type { PermissionItem } from '@app/components/PermissionOption'; import type { PermissionItem } from '@app/components/PermissionOption';
import PermissionOption from '@app/components/PermissionOption'; import PermissionOption from '@app/components/PermissionOption';
import useSettings from '@app/hooks/useSettings';
import type { User } from '@app/hooks/useUser'; import type { User } from '@app/hooks/useUser';
import { Permission } from '@app/hooks/useUser'; import { Permission } from '@app/hooks/useUser';
import { MediaServerType } from '@server/constants/server';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
export const messages = defineMessages({ export const messages = defineMessages({
@@ -72,9 +74,9 @@ export const messages = defineMessages({
viewrecent: 'View Recently Added', viewrecent: 'View Recently Added',
viewrecentDescription: viewrecentDescription:
'Grant permission to view the list of recently added media.', 'Grant permission to view the list of recently added media.',
viewwatchlists: 'View Plex Watchlists', viewwatchlists: 'View {mediaServerName} Watchlists',
viewwatchlistsDescription: viewwatchlistsDescription:
"Grant permission to view other users' Plex Watchlists.", "Grant permission to view other users' {mediaServerName} Watchlists.",
}); });
interface PermissionEditProps { interface PermissionEditProps {
@@ -91,6 +93,7 @@ export const PermissionEdit = ({
onUpdate, onUpdate,
}: PermissionEditProps) => { }: PermissionEditProps) => {
const intl = useIntl(); const intl = useIntl();
const settings = useSettings();
const permissionList: PermissionItem[] = [ const permissionList: PermissionItem[] = [
{ {
@@ -131,8 +134,24 @@ export const PermissionEdit = ({
}, },
{ {
id: 'viewwatchlists', id: 'viewwatchlists',
name: intl.formatMessage(messages.viewwatchlists), name: intl.formatMessage(messages.viewwatchlists, {
description: intl.formatMessage(messages.viewwatchlistsDescription), mediaServerName:
settings.currentSettings.mediaServerType === MediaServerType.PLEX
? 'Plex'
: settings.currentSettings.mediaServerType ===
MediaServerType.JELLYFIN
? 'Jellyfin'
: 'Emby',
}),
description: intl.formatMessage(messages.viewwatchlistsDescription, {
mediaServerName:
settings.currentSettings.mediaServerType === MediaServerType.PLEX
? 'Plex'
: settings.currentSettings.mediaServerType ===
MediaServerType.JELLYFIN
? 'Jellyfin'
: 'Emby',
}),
permission: Permission.WATCHLIST_VIEW, permission: Permission.WATCHLIST_VIEW,
}, },
], ],

View File

@@ -23,7 +23,7 @@ const messages = defineMessages({
toastSettingsFailure: 'Something went wrong while saving settings.', toastSettingsFailure: 'Something went wrong while saving settings.',
localLogin: 'Enable Local Sign-In', localLogin: 'Enable Local Sign-In',
localLoginTip: localLoginTip:
'Allow users to sign in using their email address and password, instead of Plex OAuth', 'Allow users to sign in using their email address and password, instead of {mediaServerName} OAuth',
newPlexLogin: 'Enable New {mediaServerName} Sign-In', newPlexLogin: 'Enable New {mediaServerName} Sign-In',
newPlexLoginTip: newPlexLoginTip:
'Allow {mediaServerName} users to sign in without first being imported', 'Allow {mediaServerName} users to sign in without first being imported',
@@ -114,7 +114,16 @@ const SettingsUsers = () => {
<label htmlFor="localLogin" className="checkbox-label"> <label htmlFor="localLogin" className="checkbox-label">
{intl.formatMessage(messages.localLogin)} {intl.formatMessage(messages.localLogin)}
<span className="label-tip"> <span className="label-tip">
{intl.formatMessage(messages.localLoginTip)} {intl.formatMessage(messages.localLoginTip, {
mediaServerName:
settings.currentSettings.mediaServerType ===
MediaServerType.PLEX
? 'Plex'
: settings.currentSettings.mediaServerType ===
MediaServerType.JELLYFIN
? 'Jellyfin'
: 'Emby',
})}
</span> </span>
</label> </label>
<div className="form-input-area"> <div className="form-input-area">

View File

@@ -394,8 +394,8 @@
"components.PermissionEdit.viewrecentDescription": "Grant permission to view the list of recently added media.", "components.PermissionEdit.viewrecentDescription": "Grant permission to view the list of recently added media.",
"components.PermissionEdit.viewrequests": "View Requests", "components.PermissionEdit.viewrequests": "View Requests",
"components.PermissionEdit.viewrequestsDescription": "Grant permission to view media requests submitted by other users.", "components.PermissionEdit.viewrequestsDescription": "Grant permission to view media requests submitted by other users.",
"components.PermissionEdit.viewwatchlists": "View Plex Watchlists", "components.PermissionEdit.viewwatchlists": "View {mediaServerName} Watchlists",
"components.PermissionEdit.viewwatchlistsDescription": "Grant permission to view other users' Plex Watchlists.", "components.PermissionEdit.viewwatchlistsDescription": "Grant permission to view other users' {mediaServerName} Watchlists.",
"components.PersonDetails.alsoknownas": "Also Known As: {names}", "components.PersonDetails.alsoknownas": "Also Known As: {names}",
"components.PersonDetails.appearsin": "Appearances", "components.PersonDetails.appearsin": "Appearances",
"components.PersonDetails.ascharacter": "as {character}", "components.PersonDetails.ascharacter": "as {character}",
@@ -852,7 +852,7 @@
"components.Settings.SettingsUsers.defaultPermissions": "Default Permissions", "components.Settings.SettingsUsers.defaultPermissions": "Default Permissions",
"components.Settings.SettingsUsers.defaultPermissionsTip": "Initial permissions assigned to new users", "components.Settings.SettingsUsers.defaultPermissionsTip": "Initial permissions assigned to new users",
"components.Settings.SettingsUsers.localLogin": "Enable Local Sign-In", "components.Settings.SettingsUsers.localLogin": "Enable Local Sign-In",
"components.Settings.SettingsUsers.localLoginTip": "Allow users to sign in using their email address and password, instead of Plex OAuth", "components.Settings.SettingsUsers.localLoginTip": "Allow users to sign in using their email address and password, instead of {mediaServerName} OAuth",
"components.Settings.SettingsUsers.movieRequestLimitLabel": "Global Movie Request Limit", "components.Settings.SettingsUsers.movieRequestLimitLabel": "Global Movie Request Limit",
"components.Settings.SettingsUsers.newPlexLogin": "Enable New {mediaServerName} Sign-In", "components.Settings.SettingsUsers.newPlexLogin": "Enable New {mediaServerName} Sign-In",
"components.Settings.SettingsUsers.newPlexLoginTip": "Allow {mediaServerName} users to sign in without first being imported", "components.Settings.SettingsUsers.newPlexLoginTip": "Allow {mediaServerName} users to sign in without first being imported",