add i18n
This commit is contained in:
@@ -6,6 +6,7 @@ import z from "zod";
|
||||
import { TextSpeakerItemSchema } from "@/interfaces";
|
||||
import IconClick from "@/components/IconClick";
|
||||
import IMAGES from "@/config/images";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
interface TextCardProps {
|
||||
item: z.infer<typeof TextSpeakerItemSchema>;
|
||||
@@ -47,6 +48,7 @@ interface SaveListProps {
|
||||
handleUse: (item: z.infer<typeof TextSpeakerItemSchema>) => void;
|
||||
}
|
||||
export default function SaveList({ show = false, handleUse }: SaveListProps) {
|
||||
const t = useTranslations("text-speaker");
|
||||
const [data, setData] = useState(getTextSpeakerData());
|
||||
const handleDel = (item: z.infer<typeof TextSpeakerItemSchema>) => {
|
||||
const current_data = getTextSpeakerData();
|
||||
@@ -61,7 +63,7 @@ export default function SaveList({ show = false, handleUse }: SaveListProps) {
|
||||
setData(getTextSpeakerData());
|
||||
};
|
||||
const handleDeleteAll = () => {
|
||||
const yesorno = prompt("确定删光吗?(Y/N)")?.trim();
|
||||
const yesorno = prompt(t("confirmDeleteAll"))?.trim();
|
||||
if (yesorno && (yesorno === "Y" || yesorno === "y")) {
|
||||
setTextSpeakerData([]);
|
||||
refresh();
|
||||
|
||||
@@ -15,8 +15,10 @@ import { TextSpeakerItemSchema } from "@/interfaces";
|
||||
import z from "zod";
|
||||
import { Navbar } from "@/components/Navbar";
|
||||
import { VOICES } from "@/config/locales";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
export default function TextSpeaker() {
|
||||
const t = useTranslations("text-speaker");
|
||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
const [showSpeedAdjust, setShowSpeedAdjust] = useState(false);
|
||||
const [showSaveList, setShowSaveList] = useState(false);
|
||||
@@ -320,7 +322,7 @@ export default function TextSpeaker() {
|
||||
selected={ipaEnabled}
|
||||
onClick={() => setIPAEnabled(!ipaEnabled)}
|
||||
>
|
||||
生成IPA
|
||||
{t("generateIPA")}
|
||||
</LightButton>
|
||||
<LightButton
|
||||
onClick={() => {
|
||||
@@ -328,7 +330,7 @@ export default function TextSpeaker() {
|
||||
}}
|
||||
selected={showSaveList}
|
||||
>
|
||||
查看保存项
|
||||
{t("viewSavedItems")}
|
||||
</LightButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user