diff --git a/ui/v2.5/src/components/Galleries/GalleryDetails/GalleryImagesPanel.tsx b/ui/v2.5/src/components/Galleries/GalleryDetails/GalleryImagesPanel.tsx index ff3d38567..e58bdb9c8 100644 --- a/ui/v2.5/src/components/Galleries/GalleryDetails/GalleryImagesPanel.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryDetails/GalleryImagesPanel.tsx @@ -78,7 +78,7 @@ export const GalleryImagesPanel: React.FC = ({ const otherOperations = [ { - text: "Remove from Gallery", + text: intl.formatMessage({ id: "actions.remove_from_gallery" }), onClick: removeImages, isDisplayed: showWhenSelected, postRefetch: true, diff --git a/ui/v2.5/src/components/MainNavbar.tsx b/ui/v2.5/src/components/MainNavbar.tsx index c98c1f5eb..3ce0f2f6d 100644 --- a/ui/v2.5/src/components/MainNavbar.tsx +++ b/ui/v2.5/src/components/MainNavbar.tsx @@ -25,7 +25,6 @@ interface IMenuItem { hotkey: string; userCreatable?: boolean; } - const messages = defineMessages({ scenes: { id: "scenes", @@ -231,7 +230,7 @@ export const MainNavbar: React.FC = () => { @@ -250,7 +249,10 @@ export const MainNavbar: React.FC = () => { target="_blank" onClick={handleDismiss} > - diff --git a/ui/v2.5/src/components/Movies/EditMoviesDialog.tsx b/ui/v2.5/src/components/Movies/EditMoviesDialog.tsx index d93a82217..713989f1f 100644 --- a/ui/v2.5/src/components/Movies/EditMoviesDialog.tsx +++ b/ui/v2.5/src/components/Movies/EditMoviesDialog.tsx @@ -102,7 +102,10 @@ export const EditMoviesDialog: React.FC = ( = ( return ( <> setName(value)} /> setAliases(value)} /> setDuration(value)} /> setDate(value)} /> setDirector(value)} /> setSynopsis(value)} /> diff --git a/ui/v2.5/src/components/Performers/EditPerformersDialog.tsx b/ui/v2.5/src/components/Performers/EditPerformersDialog.tsx index 83d135c75..5d8e4ed15 100644 --- a/ui/v2.5/src/components/Performers/EditPerformersDialog.tsx +++ b/ui/v2.5/src/components/Performers/EditPerformersDialog.tsx @@ -198,7 +198,10 @@ export const EditPerformersDialog: React.FC = ( = ({ performer }) => { ) : ( )} diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/PerformerCreate.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/PerformerCreate.tsx index 33b60f92b..e8ef54f27 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/PerformerCreate.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/PerformerCreate.tsx @@ -1,4 +1,5 @@ import React, { useState } from "react"; +import { FormattedMessage, useIntl } from "react-intl"; import { LoadingIndicator } from "src/components/Shared"; import { PerformerEditPanel } from "./PerformerEditPanel"; @@ -7,6 +8,7 @@ const PerformerCreate: React.FC = () => { const [imageEncoding, setImageEncoding] = useState(false); const activeImage = imagePreview ?? ""; + const intl = useIntl(); const onImageChange = (image?: string | null) => setImagePreview(image); const onImageEncoding = (isEncoding = false) => setImageEncoding(isEncoding); @@ -16,7 +18,13 @@ const PerformerCreate: React.FC = () => { return ; } if (activeImage) { - return Performer; + return ( + {intl.formatMessage({ + ); } } @@ -26,7 +34,12 @@ const PerformerCreate: React.FC = () => { {renderPerformerImage()}
-

Create Performer

+

+ +

= ({ const imageEncoding = ImageUtils.usePasteImage(onImageLoad, true); const [createTag] = useTagCreate(); + const intl = useIntl(); const genderOptions = [""].concat(genderStrings); @@ -775,7 +776,7 @@ export const PerformerEditPanel: React.FC = ({ diff --git a/ui/v2.5/src/components/Settings/SettingsServicesPanel.tsx b/ui/v2.5/src/components/Settings/SettingsServicesPanel.tsx index e15c29ead..0a7945d59 100644 --- a/ui/v2.5/src/components/Settings/SettingsServicesPanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsServicesPanel.tsx @@ -57,10 +57,18 @@ export const SettingsServicesPanel: React.FC = () => { try { if (enableDisable) { await enableDLNA(input); - Toast.success({ content: "Enabled DLNA temporarily" }); + Toast.success({ + content: intl.formatMessage({ + id: "config.dlna.enabled_dlna_temporarily", + }), + }); } else { await disableDLNA(input); - Toast.success({ content: "Disabled DLNA temporarily" }); + Toast.success({ + content: intl.formatMessage({ + id: "config.dlna.disabled_dlna_temporarily", + }), + }); } } catch (e) { Toast.error(e); @@ -86,7 +94,11 @@ export const SettingsServicesPanel: React.FC = () => { try { await addTempDLANIP(input); - Toast.success({ content: "Allowed IP temporarily" }); + Toast.success({ + content: intl.formatMessage({ + id: "config.dlna.allowed_ip_temporarily", + }), + }); } catch (e) { Toast.error(e); } finally { @@ -106,7 +118,9 @@ export const SettingsServicesPanel: React.FC = () => { try { await removeTempDLNAIP(input); - Toast.success({ content: "Disallowed IP" }); + Toast.success({ + content: intl.formatMessage({ id: "config.dlna.disallowed_ip" }), + }); } catch (e) { Toast.error(e); } finally { @@ -184,7 +198,11 @@ export const SettingsServicesPanel: React.FC = () => { } else { await disableDLNA(input); } - Toast.success({ content: "Successfully cancelled temporary behaviour" }); + Toast.success({ + content: intl.formatMessage({ + id: "config.dlna.successfully_cancelled_temporary_behaviour", + }), + }); } catch (e) { Toast.error(e); } finally { diff --git a/ui/v2.5/src/components/Shared/FolderSelect/FolderSelect.tsx b/ui/v2.5/src/components/Shared/FolderSelect/FolderSelect.tsx index 4e88c2a2c..e7068a97a 100644 --- a/ui/v2.5/src/components/Shared/FolderSelect/FolderSelect.tsx +++ b/ui/v2.5/src/components/Shared/FolderSelect/FolderSelect.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState, useMemo } from "react"; -import { FormattedMessage } from "react-intl"; +import { FormattedMessage, useIntl } from "react-intl"; import { Button, InputGroup, Form } from "react-bootstrap"; import { debounce } from "lodash"; import { Icon, LoadingIndicator } from "src/components/Shared"; @@ -22,6 +22,7 @@ export const FolderSelect: React.FC = ({ currentDirectory ); const { data, error, loading } = useDirectory(debouncedDirectory); + const intl = useIntl(); const selectableDirectories: string[] = currentDirectory ? data?.directory.directories ?? defaultDirectories ?? [] @@ -62,7 +63,7 @@ export const FolderSelect: React.FC = ({ currentDirectory && data?.directory?.parent ? (
  • ) : null; @@ -71,7 +72,7 @@ export const FolderSelect: React.FC = ({ <> ) => { setDebounced(e.currentTarget.value); }} diff --git a/ui/v2.5/src/components/Shared/Select.tsx b/ui/v2.5/src/components/Shared/Select.tsx index 602c53e71..998046750 100644 --- a/ui/v2.5/src/components/Shared/Select.tsx +++ b/ui/v2.5/src/components/Shared/Select.tsx @@ -25,6 +25,7 @@ import { useToast } from "src/hooks"; import { TextUtils } from "src/utils"; import { SelectComponents } from "react-select/src/components"; import { ConfigurationContext } from "src/hooks/Config"; +import { useIntl } from "react-intl"; export type ValidTypes = | GQL.SlimPerformerDataFragment @@ -402,6 +403,7 @@ export const PerformerSelect: React.FC = (props) => { const [createPerformer] = usePerformerCreate(); const { configuration } = React.useContext(ConfigurationContext); + const intl = useIntl(); const defaultCreatable = !configuration?.interface.disableDropdownCreate.performer ?? true; @@ -426,7 +428,13 @@ export const PerformerSelect: React.FC = (props) => { type="performers" isLoading={loading} items={performers} - placeholder={props.noSelectionString ?? "Select performer..."} + placeholder={ + props.noSelectionString ?? + intl.formatMessage( + { id: "actions.select_entity" }, + { entityType: intl.formatMessage({ id: "performer" }) } + ) + } /> ); }; @@ -440,6 +448,7 @@ export const StudioSelect: React.FC< const [allAliases, setAllAliases] = useState([]); const { data, loading } = useAllStudiosForFilter(); const [createStudio] = useStudioCreate(); + const intl = useIntl(); const { configuration } = React.useContext(ConfigurationContext); const defaultCreatable = @@ -550,7 +559,13 @@ export const StudioSelect: React.FC< type="studios" isLoading={loading} items={studios} - placeholder={props.noSelectionString ?? "Select studio..."} + placeholder={ + props.noSelectionString ?? + intl.formatMessage( + { id: "actions.select_entity" }, + { entityType: intl.formatMessage({ id: "studio" }) } + ) + } creatable={props.creatable ?? defaultCreatable} onCreate={onCreate} /> @@ -560,6 +575,7 @@ export const StudioSelect: React.FC< export const MovieSelect: React.FC = (props) => { const { data, loading } = useAllMoviesForFilter(); const items = data?.allMovies ?? []; + const intl = useIntl(); return ( = (props) => { type="movies" isLoading={loading} items={items} - placeholder={props.noSelectionString ?? "Select movie..."} + placeholder={ + props.noSelectionString ?? + intl.formatMessage( + { id: "actions.select_entity" }, + { entityType: intl.formatMessage({ id: "movie" }) } + ) + } /> ); }; @@ -580,7 +602,13 @@ export const TagSelect: React.FC = ( const [allAliases, setAllAliases] = useState([]); const { data, loading } = useAllTagsForFilter(); const [createTag] = useTagCreate(); - const placeholder = props.noSelectionString ?? "Select tags..."; + const intl = useIntl(); + const placeholder = + props.noSelectionString ?? + intl.formatMessage( + { id: "actions.select_entity" }, + { entityType: intl.formatMessage({ id: "tags" }) } + ); const { configuration } = React.useContext(ConfigurationContext); const defaultCreatable = diff --git a/ui/v2.5/src/components/Tagger/scenes/sceneTaggerModals.tsx b/ui/v2.5/src/components/Tagger/scenes/sceneTaggerModals.tsx index 812dc3c3c..0e40d408a 100644 --- a/ui/v2.5/src/components/Tagger/scenes/sceneTaggerModals.tsx +++ b/ui/v2.5/src/components/Tagger/scenes/sceneTaggerModals.tsx @@ -4,6 +4,7 @@ import * as GQL from "src/core/generated-graphql"; import StudioModal from "./StudioModal"; import PerformerModal from "../PerformerModal"; import { TaggerStateContext } from "../context"; +import { useIntl } from "react-intl"; type PerformerModalCallback = (toCreate?: GQL.PerformerCreateInput) => void; type StudioModalCallback = (toCreate?: GQL.StudioCreateInput) => void; @@ -43,6 +44,8 @@ export const SceneTaggerModals: React.FC = ({ children }) => { StudioModalCallback | undefined >(); + const intl = useIntl(); + function handlePerformerSave(toCreate: GQL.PerformerCreateInput) { if (performerCallback) { performerCallback(toCreate); @@ -110,7 +113,10 @@ export const SceneTaggerModals: React.FC = ({ children }) => { performer={performerToCreate} onSave={handlePerformerSave} icon="tags" - header="Create Performer" + header={intl.formatMessage( + { id: "actions.create_entity" }, + { entityType: intl.formatMessage({ id: "performer" }) } + )} endpoint={endpoint} create /> @@ -122,7 +128,10 @@ export const SceneTaggerModals: React.FC = ({ children }) => { studio={studioToCreate} handleStudioCreate={handleStudioSave} icon="tags" - header="Create Studio" + header={intl.formatMessage( + { id: "actions.create_entity" }, + { entityType: intl.formatMessage({ id: "studio" }) } + )} /> )} {children} diff --git a/ui/v2.5/src/components/Tags/TagDetails/TagEditPanel.tsx b/ui/v2.5/src/components/Tags/TagDetails/TagEditPanel.tsx index a59e8cea9..e69e5d0ad 100644 --- a/ui/v2.5/src/components/Tags/TagDetails/TagEditPanel.tsx +++ b/ui/v2.5/src/components/Tags/TagDetails/TagEditPanel.tsx @@ -135,7 +135,7 @@ export const TagEditPanel: React.FC = ({ diff --git a/ui/v2.5/src/hooks/Lightbox/Lightbox.tsx b/ui/v2.5/src/hooks/Lightbox/Lightbox.tsx index 49456641a..2a74e8541 100644 --- a/ui/v2.5/src/hooks/Lightbox/Lightbox.tsx +++ b/ui/v2.5/src/hooks/Lightbox/Lightbox.tsx @@ -592,7 +592,9 @@ export const LightboxComponent: React.FC = ({