Skip to content

Commit

Permalink
fix(front): fix localization
Browse files Browse the repository at this point in the history
  • Loading branch information
SARDONYX-sard committed Nov 5, 2023
1 parent 765fa8f commit 5f6f04a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export function ConvertForm() {
}}
onBlur={onBlur}
error={Boolean(error)}
helperText={t("")}
helperText={t("convert-form-author-name-helper")}
/>
)}
/>
Expand Down
12 changes: 9 additions & 3 deletions frontend/src/components/pages/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ import "ace-builds/src-noconflict/mode-javascript";
import "ace-builds/src-noconflict/snippets/css";
import "ace-builds/src-noconflict/snippets/javascript";
import "ace-builds/src-noconflict/theme-one_dark";
import { useTranslation } from "react-i18next";

export default function Settings() {
useLocale();
const [editorMode, setEditorMode] = useStorageState("editorMode", "default");
const [preset, setPreset] = useStorageState("presetNumber", "0");
const [style, setStyle] = useDynStyle();
useLocale();

const setEditorKeyMode = (editorMode: EditorMode) => {
setEditorMode(editorMode ?? "default");
Expand Down Expand Up @@ -89,9 +90,13 @@ const CSSEditor = ({
setStyle,
style,
}: CSSEditorProps) => {
const { t } = useTranslation();

return (
<>
<InputLabel sx={{ marginTop: "20px" }}>Custom CSS</InputLabel>
<InputLabel sx={{ marginTop: "20px" }}>
{t("custom-css-label")}
</InputLabel>
<AceEditor
style={{
width: "95%",
Expand Down Expand Up @@ -126,12 +131,13 @@ type JSEditorProps = {
editorMode: string;
};
const JSEditor = ({ editorMode }: JSEditorProps) => {
const { t } = useTranslation();
const [script, setScript] = useInjectScript();

return (
<>
<InputLabel error sx={{ marginTop: "20px" }}>
Custom JavaScript(Please do not execute untrusted scripts)
{t("custom-js-label")}
</InputLabel>
<AceEditor
style={{
Expand Down
2 changes: 2 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"css-preset-list-label": "CSS Preset",
"css-preset-list-tooltip": "You can choose a CSS preset.",
"css-preset-list-tooltip2": "NOTE: The moment you edit the preset, Yourself CSS will be overwritten.",
"custom-css-label": "Custom CSS",
"custom-js-label": "Custom JavaScript(Please do not execute untrusted scripts)",
"editor-mode-list-label": "Editor Mode",
"hide-dar-btn": "Hide DAR",
"hide-dar-btn-tooltip": "After conversion, append \".mohidden\" to the DAR dirname in \"DAR(src) Directory*\" to make it a hidden directory(For MO2 users)",
Expand Down
6 changes: 4 additions & 2 deletions locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
"css-preset-list-label": "プリセット",
"css-preset-list-tooltip": "CSS presetを選択",
"css-preset-list-tooltip2": "注意: 「プリセット」を編集すると「カスタム」が上書きされます",
"custom-css-label": "カスタムCSS",
"custom-js-label": "カスタムJavaScript(信用できないスクリプトは実行しないでください)",
"editor-mode-list-label": "編集モード",
"hide-dar-btn": "DARを非表示",
"hide-dar-btn-tooltip": "変換後に\"DAR(src) Directory*\"\".mohidden\"を追加して隠しディレクトリ化(MO2ユーザ向け)",
"hide-dar-btn-tooltip2": "注意: DARの保存先と違うドライブや権限がない場合、エラーします",
"hide-dar-btn-tooltip2": "注意: DARの保存先の書き込み権限がない場合、エラーが発生する可能性があります",
"log-level-list-label": "ログレベル",
"mapping-wiki-url-leaf": "wiki#what-is-the-mapping-file",
"open-log-btn": "ログを開く",
Expand All @@ -38,7 +40,7 @@
"progress-btn-tooltip2": "注意: 変換時間が5~10秒以上増加する可能性があります",
"remove-oar-btn": "OARを削除",
"remove-oar-success": "OARディレクトリを削除しました",
"remove-oar-tooltip": "DAR(src)/OAR(dist)からOARディレクトリを捜索して削除します",
"remove-oar-tooltip": "OAR(dist)(なければDAR(src))からOARディレクトリを捜索して削除します",
"run-parallel-btn-tooltip": "マルチスレッドを使用します",
"run-parallel-btn-tooltip2": "大抵の場合で数十ミリ秒遅延しますが、コピー対象が少なく、CPU処理の比重が大きい(\"_condition.txt\"の解析が多い)時には有効かもしれません。",
"run-parallel-label": "並列実行",
Expand Down

0 comments on commit 5f6f04a

Please sign in to comment.