Commit bde09892 authored by tyyin lan's avatar tyyin lan

build: i18n增加类型提示

parent 7714821d
...@@ -2,7 +2,7 @@ import { type App } from 'vue' ...@@ -2,7 +2,7 @@ import { type App } from 'vue'
import { createI18n } from 'vue-i18n' import { createI18n } from 'vue-i18n'
import messages from './messages' import messages from './messages'
const i18n = createI18n({ const i18n = createI18n<[I18n.Schema], I18n.LangType>({
legacy: false, legacy: false,
locale: 'zh-CN', locale: 'zh-CN',
fallbackLocale: 'zh-HK', fallbackLocale: 'zh-HK',
......
home_module:
agent_welcome_message: 'Hi, 歡迎使用SuperLink'
agent_description: '在这里,你可以体验多个平台的模型和专属的智能体'
common_module: common_module:
cancel_btn_text: ' 消' cancel_btn_text: ' 消'
confirm_btn_text: ' 认' confirm_btn_text: ' 认'
...@@ -70,6 +66,13 @@ common_module: ...@@ -70,6 +66,13 @@ common_module:
total: '共' total: '共'
goto: '跳转至' goto: '跳转至'
login_module:
app_welcome_words: '欢迎使用萃想POC'
home_module:
agent_welcome_message: 'Hi, 歡迎使用SuperLink'
agent_description: '在这里,你可以体验多个平台的模型和专属的智能体'
router_title_module: router_title_module:
login: '登录' login: '登录'
server_error: '服务器错误' server_error: '服务器错误'
......
home_module:
agent_welcome_message: 'Hi, 歡迎使用SuperLink'
agent_description: '在這裏,你可以體驗多個平臺的模型和專屬的智'
common_module: common_module:
cancel_btn_text: ' 消' cancel_btn_text: ' 消'
confirm_btn_text: ' 認' confirm_btn_text: ' 認'
...@@ -70,6 +66,13 @@ common_module: ...@@ -70,6 +66,13 @@ common_module:
total: '共' total: '共'
goto: '跳轉至' goto: '跳轉至'
login_module:
app_welcome_words: '歡迎使用萃想POC'
home_module:
agent_welcome_message: 'Hi, 歡迎使用SuperLink'
agent_description: '在這裏,你可以體驗多個平臺的模型和專屬的智'
router_title_module: router_title_module:
login: '登錄' login: '登錄'
server_error: '服務器錯誤' server_error: '服務器錯誤'
......
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { DefineLocaleMessage, DefineDateTimeFormat, DefineNumberFormat } from 'vue-i18n'
declare module 'vue-i18n' {
// define the locale messages schema
export interface DefineLocaleMessage extends I18n.Schema {}
// define the datetime format schema
export interface DefineDateTimeFormat {}
// define the number format schema
export interface DefineNumberFormat {}
}
...@@ -2,11 +2,6 @@ declare namespace I18n { ...@@ -2,11 +2,6 @@ declare namespace I18n {
type LangType = 'zh-HK' | 'zh-CN' type LangType = 'zh-HK' | 'zh-CN'
type Schema = { type Schema = {
home_module: {
agent_welcome_message: string
agent_description: string
}
common_module: { common_module: {
cancel_btn_text: string cancel_btn_text: string
confirm_btn_text: string confirm_btn_text: string
...@@ -76,6 +71,15 @@ declare namespace I18n { ...@@ -76,6 +71,15 @@ declare namespace I18n {
} }
} }
login_module: {
app_welcome_words: string
}
home_module: {
agent_welcome_message: string
agent_description: string
}
router_title_module: { router_title_module: {
login: string login: string
server_error: string server_error: string
......
declare module '*.yaml' {
const value: I18n.Schema
export default value
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment