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:
Still Hsu
2021-06-14 14:48:59 +09:00
committed by GitHub
parent 46bbede9a0
commit 3ae187e6f0
105 changed files with 3441 additions and 1084 deletions

View File

@@ -10,6 +10,7 @@ import {
} from "react-bootstrap";
import { CollapseButton, Icon, Modal } from "src/components/Shared";
import _ from "lodash";
import { FormattedMessage, useIntl } from "react-intl";
export class ScrapeResult<T> {
public newValue?: T;
@@ -336,6 +337,7 @@ interface IScrapeDialogProps {
export const ScrapeDialog: React.FC<IScrapeDialogProps> = (
props: IScrapeDialogProps
) => {
const intl = useIntl();
return (
<Modal
show
@@ -345,11 +347,11 @@ export const ScrapeDialog: React.FC<IScrapeDialogProps> = (
onClick: () => {
props.onClose(true);
},
text: "Apply",
text: intl.formatMessage({ id: "actions.apply" }),
}}
cancel={{
onClick: () => props.onClose(),
text: "Cancel",
text: intl.formatMessage({ id: "actions.cancel" }),
variant: "secondary",
}}
modalProps={{ size: "lg", dialogClassName: "scrape-dialog" }}
@@ -360,10 +362,10 @@ export const ScrapeDialog: React.FC<IScrapeDialogProps> = (
<Col lg={{ span: 9, offset: 3 }}>
<Row>
<Form.Label column xs="6">
Existing
<FormattedMessage id="dialogs.scrape_results_existing" />
</Form.Label>
<Form.Label column xs="6">
Scraped
<FormattedMessage id="dialogs.scrape_results_scraped" />
</Form.Label>
</Row>
</Col>