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

@@ -1,5 +1,6 @@
import React, { useState } from "react";
import _ from "lodash";
import { useIntl } from "react-intl";
import { useHistory } from "react-router-dom";
import Mousetrap from "mousetrap";
import {
@@ -32,6 +33,7 @@ export const SceneList: React.FC<ISceneList> = ({
defaultSort,
persistState,
}) => {
const intl = useIntl();
const history = useHistory();
const [isGenerateDialogOpen, setIsGenerateDialogOpen] = useState(false);
const [isExportDialogOpen, setIsExportDialogOpen] = useState(false);
@@ -39,26 +41,26 @@ export const SceneList: React.FC<ISceneList> = ({
const otherOperations = [
{
text: "Play selected",
text: intl.formatMessage({ id: "actions.play_selected" }),
onClick: playSelected,
isDisplayed: showWhenSelected,
},
{
text: "Play Random",
text: intl.formatMessage({ id: "actions.play_random" }),
onClick: playRandom,
},
{
text: "Generate...",
text: intl.formatMessage({ id: "actions.generate" }),
onClick: generate,
isDisplayed: showWhenSelected,
},
{
text: "Export...",
text: intl.formatMessage({ id: "actions.export" }),
onClick: onExport,
isDisplayed: showWhenSelected,
},
{
text: "Export all...",
text: intl.formatMessage({ id: "actions.export_all" }),
onClick: onExportAll,
},
];