diff --git a/src/language/en-US.json b/src/language/en-US.json new file mode 100644 index 0000000..b1e0e6f --- /dev/null +++ b/src/language/en-US.json @@ -0,0 +1,36 @@ +{ + "common": { + "ok": "OK", + "notice": "Notice" + }, + "components": {}, + "features": {}, + "pages": { + "home": "Home", + "login": { + "title": "Test System", + "illustrationTitle": "Login Page", + "illustrationDescription": "Login to your account", + "welcomeText": "Welcome back 👋🏻", + "welcomeDescription": "Please enter your account password to login", + "organization": "Hyakkaou Private Academy", + "accPlaceholder": "Enter account", + "passwPlaceholder": "Enter password", + "rememberMeLabel": "Remember me", + "forgotPasswordText": "Forgot password?", + "createAccountPromptText": "Don't have an account?", + "createAccountLinkText": "Create an account", + "submitText": "Login", + "verifyText": "Verify", + "captchaPlaceholder": "Enter captcha", + "refreshTitle": "Refresh captcha", + "alert": { + "verifyRequired": "Please complete the captcha first", + "verifySuccess": "Verification successful", + "verifyFailed": "Verification failed", + "loginFailed": "Login failed", + "loginSuccess": "Login success!" + } + } + } +} diff --git a/src/language/zh-TW.json b/src/language/zh-TW.json new file mode 100644 index 0000000..02a04f7 --- /dev/null +++ b/src/language/zh-TW.json @@ -0,0 +1,36 @@ +{ + "common": { + "ok": "確定", + "notice": "提示" + }, + "components": {}, + "features": {}, + "pages": { + "home": "首頁", + "login": { + "title": "測試系統", + "illustrationTitle": "這是登入頁", + "illustrationDescription": "你可以在這頁登入", + "welcomeText": "歡迎回來 👋🏻", + "welcomeDescription": "請輸入您的帳號密碼進行登入", + "organization": "私立百花王學園", + "accPlaceholder": "請輸入帳號", + "passwPlaceholder": "請輸入密碼", + "rememberMeLabel": "記住帳號", + "forgotPasswordText": "忘記密碼?", + "createAccountPromptText": "還沒有帳號?", + "createAccountLinkText": "註冊帳號", + "submitText": "登入", + "verifyText": "驗證", + "captchaPlaceholder": "請輸入驗證碼", + "refreshTitle": "點擊刷新驗證碼", + "alert": { + "verifyRequired": "請先完成驗證碼", + "verifySuccess": "驗證成功", + "verifyFailed": "驗證失敗", + "loginFailed": "登入失敗", + "loginSuccess": "登入成功!" + } + } + } +} diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 73640f9..4bd4d65 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -1,21 +1,18 @@ import { createI18n } from 'vue-i18n' +import en from '@/language/en-US.json' +import zh from '@/language/zh-TW.json' + const messages = { - en: { - message: { - hello: 'hello world', - }, - }, - ja: { - message: { - hello: 'こんにちは、世界', - }, - }, + 'zh-TW': zh, + 'en-US': en, } +const defaultLocale = localStorage.getItem('locale') ?? 'zh-TW' + export default createI18n({ legacy: false, - locale: 'en', - fallbackLocale: 'en', + locale: defaultLocale, + fallbackLocale: 'en-US', messages, })