mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Incorporate i18n into UI elements (#1471)
* Update zh-tw string table (till 975343d2)
* Prepare localization table
* Implement i18n for Performers & Tags
* Add "add" action strings
* Use Lodash merge for deep merging language JSONs
The original implementation does not properly merge language files, causing unexpected localization string fallback behavior.
* Localize pagination strings
* Use Field name value as null id fallback
...otherwise FormattedMessage is gonna throw when the ID is null
* Use localized "Path" string for all instances
* Localize the "Interface" tab under settings
* Localize scene & performer cards
* Rename locale folder for better compatibility with i18n-ally
* Localize majority of the categories and features
This commit is contained in:
@@ -2,6 +2,7 @@ import React from "react";
|
||||
import { Button, Modal, Spinner, ModalProps } from "react-bootstrap";
|
||||
import { Icon } from "src/components/Shared";
|
||||
import { IconName } from "@fortawesome/fontawesome-svg-core";
|
||||
import { FormattedMessage } from "react-intl";
|
||||
|
||||
interface IButton {
|
||||
text?: string;
|
||||
@@ -58,7 +59,13 @@ const ModalComponent: React.FC<IModal> = ({
|
||||
onClick={cancel.onClick}
|
||||
className="mr-2"
|
||||
>
|
||||
{cancel.text ?? "Cancel"}
|
||||
{cancel.text ?? (
|
||||
<FormattedMessage
|
||||
id="actions.cancel"
|
||||
defaultMessage="Cancel"
|
||||
description="Cancels the current action and dismisses the modal."
|
||||
/>
|
||||
)}
|
||||
</Button>
|
||||
) : (
|
||||
""
|
||||
@@ -72,7 +79,13 @@ const ModalComponent: React.FC<IModal> = ({
|
||||
{isRunning ? (
|
||||
<Spinner animation="border" role="status" size="sm" />
|
||||
) : (
|
||||
accept?.text ?? "Close"
|
||||
accept?.text ?? (
|
||||
<FormattedMessage
|
||||
id="actions.close"
|
||||
defaultMessage="Close"
|
||||
description="Closes the current modal."
|
||||
/>
|
||||
)
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user