Merge pull request #1495 from brownrw8/i18n-continued

Uncomment i18n Feature + Add to Welcome Page
This commit is contained in:
akfoster 2025-01-27 16:11:05 -08:00 committed by GitHub
commit e506f48da8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 13 deletions

View file

@ -5,7 +5,7 @@ import { useExtensionState } from "../../context/ExtensionStateContext"
import { validateApiConfiguration, validateModelId } from "../../utils/validate"
import { vscode } from "../../utils/vscode"
import ApiOptions from "./ApiOptions"
//import LanguageOptions from "./LanguageOptions"
import LanguageOptions from "./LanguageOptions"
import SettingsButton from "../common/SettingsButton"
const IS_DEV = false // FIXME: use flags when packaging
@ -117,9 +117,9 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
{t("customInstructionsDescription")}
</p>
</div>
{/*<div style={{ marginBottom: 5 }}>
<div style={{ marginBottom: 5 }}>
<LanguageOptions />
</div>*/}
</div>
{IS_DEV && (
<>

View file

@ -5,6 +5,7 @@ import { validateApiConfiguration } from "../../utils/validate"
import { vscode } from "../../utils/vscode"
import ApiOptions from "../settings/ApiOptions"
import { useTranslation } from "react-i18next"
import LanguageOptions from "../settings/LanguageOptions"
import { Trans } from "react-i18next"
const WelcomeView = () => {
@ -53,6 +54,7 @@ const WelcomeView = () => {
<div style={{ marginTop: "10px" }}>
<ApiOptions showModelOptions={false} />
<LanguageOptions />
<VSCodeButton onClick={handleSubmit} disabled={disableLetsGoButton} style={{ marginTop: "3px" }}>
{t("letsGo")}
</VSCodeButton>

View file

@ -2,11 +2,11 @@ import i18n from "i18next"
import { initReactI18next } from "react-i18next"
import translationEN from "./locales/en/translation.json"
//import translationES from "./locales/es/translation.json"
//import translationDE from "./locales/de/translation.json"
//import translationZHCN from "./locales/zh-cn/translation.json"
//import translationZHTW from "./locales/zh-tw/translation.json"
//import translationJA from "./locales/ja/translation.json"
import translationES from "./locales/es/translation.json"
import translationDE from "./locales/de/translation.json"
import translationZHCN from "./locales/zh-cn/translation.json"
import translationZHTW from "./locales/zh-tw/translation.json"
import translationJA from "./locales/ja/translation.json"
i18n.use(initReactI18next) // passes i18n down to react-i18next
.init({
@ -20,10 +20,10 @@ i18n.use(initReactI18next) // passes i18n down to react-i18next
})
i18n.addResourceBundle("en", "translation", translationEN)
//i18n.addResourceBundle("es", "translation", translationES)
//i18n.addResourceBundle("de", "translation", translationDE)
//i18n.addResourceBundle("zh-CN", "translation", translationZHCN)
//i18n.addResourceBundle("zh-TW", "translation", translationZHTW)
//i18n.addResourceBundle("ja", "translation", translationJA)
i18n.addResourceBundle("es", "translation", translationES)
i18n.addResourceBundle("de", "translation", translationDE)
i18n.addResourceBundle("zh-CN", "translation", translationZHCN)
i18n.addResourceBundle("zh-TW", "translation", translationZHTW)
i18n.addResourceBundle("ja", "translation", translationJA)
export default i18n