feat: Add i18n support for Chinese language (#142)

* feat: Add i18n support for Chinese language

* fix: locale not working in Docker environment
This commit is contained in:
Jungley
2023-03-25 23:42:48 +08:00
committed by GitHub
parent 932853f1ba
commit 92eab6c634
26 changed files with 320 additions and 40 deletions
+4 -2
View File
@@ -1,5 +1,6 @@
import { OpenAIModel } from "@/types";
import { FC } from "react";
import { useTranslation } from "next-i18next";
interface Props {
model: OpenAIModel;
@@ -8,12 +9,13 @@ interface Props {
}
export const ModelSelect: FC<Props> = ({ model, models, onModelChange }) => {
const {t} = useTranslation('chat')
return (
<div className="flex flex-col">
<label className="text-left mb-2 dark:text-neutral-400 text-neutral-700">Model</label>
<label className="text-left mb-2 dark:text-neutral-400 text-neutral-700">{t('Model')}</label>
<select
className="w-full p-3 dark:text-white dark:bg-[#343541] border border-neutral-500 rounded-lg appearance-none focus:shadow-outline text-neutral-900 cursor-pointer"
placeholder="Select a model"
placeholder={t("Select a model") || ''}
value={model.id}
onChange={(e) => {
onModelChange(models.find((model) => model.id === e.target.value) as OpenAIModel);