@qhr123/sa2kit 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -0
- package/dist/analytics/index.d.mts +741 -0
- package/dist/analytics/index.d.ts +741 -0
- package/dist/analytics/index.js +1215 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/analytics/index.mjs +1164 -0
- package/dist/analytics/index.mjs.map +1 -0
- package/dist/i18n/index.d.mts +306 -0
- package/dist/i18n/index.d.ts +306 -0
- package/dist/i18n/index.js +369 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/index.mjs +360 -0
- package/dist/i18n/index.mjs.map +1 -0
- package/package.json +15 -1
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* i18n 类型定义
|
|
3
|
+
*/
|
|
4
|
+
type Locale = 'zh-CN' | 'zh-TW' | 'en-US' | 'ja-JP';
|
|
5
|
+
type TranslationKey = string;
|
|
6
|
+
type TranslationValue = string | {
|
|
7
|
+
[key: string]: TranslationValue;
|
|
8
|
+
};
|
|
9
|
+
type Translations = {
|
|
10
|
+
[key: string]: TranslationValue;
|
|
11
|
+
};
|
|
12
|
+
type LocaleResources = {
|
|
13
|
+
[locale in Locale]?: Translations;
|
|
14
|
+
};
|
|
15
|
+
interface TranslateOptions {
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
count?: number;
|
|
18
|
+
context?: Record<string, any>;
|
|
19
|
+
}
|
|
20
|
+
type InterpolateFunction = (template: string, data: Record<string, any>) => string;
|
|
21
|
+
interface I18nConfig {
|
|
22
|
+
locale: Locale;
|
|
23
|
+
fallbackLocale?: Locale;
|
|
24
|
+
resources: LocaleResources;
|
|
25
|
+
interpolate?: InterpolateFunction;
|
|
26
|
+
}
|
|
27
|
+
interface I18nInstance {
|
|
28
|
+
locale: Locale;
|
|
29
|
+
t: (key: string, options?: TranslateOptions) => string;
|
|
30
|
+
setLocale: (locale: Locale) => void;
|
|
31
|
+
addResources: (locale: Locale, resources: Translations) => void;
|
|
32
|
+
getLocale: () => Locale;
|
|
33
|
+
}
|
|
34
|
+
interface I18nAdapter {
|
|
35
|
+
getSystemLocale: () => Locale;
|
|
36
|
+
saveLocale: (locale: Locale) => Promise<void>;
|
|
37
|
+
loadLocale: () => Promise<Locale | null>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 轻量级 i18n 核心实现
|
|
42
|
+
* 支持:翻译、插值、复数、嵌套键、类型安全
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 创建 i18n 实例
|
|
47
|
+
*/
|
|
48
|
+
declare function createI18n(config: I18nConfig): I18nInstance;
|
|
49
|
+
/**
|
|
50
|
+
* 初始化全局 i18n
|
|
51
|
+
*/
|
|
52
|
+
declare function initI18n(config: I18nConfig): I18nInstance;
|
|
53
|
+
/**
|
|
54
|
+
* 获取全局 i18n 实例
|
|
55
|
+
*/
|
|
56
|
+
declare function getI18n(): I18nInstance;
|
|
57
|
+
/**
|
|
58
|
+
* 快捷翻译函数
|
|
59
|
+
*/
|
|
60
|
+
declare function t(key: string, options?: TranslateOptions): string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* React hooks for i18n
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* useTranslation Hook
|
|
68
|
+
* React 组件中使用翻译
|
|
69
|
+
*/
|
|
70
|
+
declare function useTranslation(): {
|
|
71
|
+
t: (key: string, options?: TranslateOptions) => string;
|
|
72
|
+
locale: Locale;
|
|
73
|
+
setLocale: (newLocale: Locale) => void;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* useLocale Hook
|
|
77
|
+
* 只获取和设置语言,不包含翻译函数
|
|
78
|
+
*/
|
|
79
|
+
declare function useLocale(): {
|
|
80
|
+
locale: Locale;
|
|
81
|
+
setLocale: (newLocale: Locale) => void;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 简体中文翻译
|
|
86
|
+
*/
|
|
87
|
+
declare const _default$1: {
|
|
88
|
+
readonly app: {
|
|
89
|
+
readonly name: "LyricNote";
|
|
90
|
+
readonly fullName: "LyricNote - 歌词笔记";
|
|
91
|
+
readonly icon: "🎵";
|
|
92
|
+
readonly description: "一个强大的歌词和笔记管理应用";
|
|
93
|
+
readonly author: "LyricNote Team";
|
|
94
|
+
readonly copyright: `\u00A9 ${number} LyricNote`;
|
|
95
|
+
readonly version: "1.0.0";
|
|
96
|
+
};
|
|
97
|
+
readonly titles: {
|
|
98
|
+
readonly main: "🎵 LyricNote";
|
|
99
|
+
readonly admin: "LyricNote 管理后台";
|
|
100
|
+
readonly withVersion: "LyricNote v1.0.0";
|
|
101
|
+
readonly welcome: "欢迎使用 LyricNote";
|
|
102
|
+
readonly about: "关于 LyricNote";
|
|
103
|
+
};
|
|
104
|
+
readonly common: {
|
|
105
|
+
readonly hello: "你好";
|
|
106
|
+
readonly welcome: "欢迎";
|
|
107
|
+
readonly confirm: "确认";
|
|
108
|
+
readonly cancel: "取消";
|
|
109
|
+
readonly save: "保存";
|
|
110
|
+
readonly delete: "删除";
|
|
111
|
+
readonly edit: "编辑";
|
|
112
|
+
readonly back: "返回";
|
|
113
|
+
readonly next: "下一步";
|
|
114
|
+
readonly submit: "提交";
|
|
115
|
+
readonly finish: "完成";
|
|
116
|
+
readonly loading: "加载中...";
|
|
117
|
+
readonly success: "操作成功";
|
|
118
|
+
readonly error: "操作失败";
|
|
119
|
+
readonly retry: "重试";
|
|
120
|
+
readonly empty: "暂无数据";
|
|
121
|
+
};
|
|
122
|
+
readonly nav: {
|
|
123
|
+
readonly home: "首页";
|
|
124
|
+
readonly lyrics: "歌词";
|
|
125
|
+
readonly create: "创作";
|
|
126
|
+
readonly collection: "收藏";
|
|
127
|
+
readonly profile: "我的";
|
|
128
|
+
readonly settings: "设置";
|
|
129
|
+
readonly history: "历史";
|
|
130
|
+
readonly logout: "退出登录";
|
|
131
|
+
};
|
|
132
|
+
readonly user: {
|
|
133
|
+
readonly login: "登录";
|
|
134
|
+
readonly register: "注册";
|
|
135
|
+
readonly username: "用户名";
|
|
136
|
+
readonly password: "密码";
|
|
137
|
+
readonly email: "邮箱";
|
|
138
|
+
readonly phone: "手机号";
|
|
139
|
+
readonly nickname: "昵称";
|
|
140
|
+
};
|
|
141
|
+
readonly pages: {
|
|
142
|
+
readonly home: {
|
|
143
|
+
readonly title: "首页";
|
|
144
|
+
readonly description: "一个强大的歌词和笔记管理应用";
|
|
145
|
+
};
|
|
146
|
+
readonly profile: {
|
|
147
|
+
readonly title: "个人中心";
|
|
148
|
+
readonly description: "管理您的个人信息和偏好设置";
|
|
149
|
+
};
|
|
150
|
+
readonly admin: {
|
|
151
|
+
readonly title: "LyricNote 管理后台";
|
|
152
|
+
readonly description: "系统管理和数据统计";
|
|
153
|
+
};
|
|
154
|
+
readonly login: {
|
|
155
|
+
readonly title: "登录";
|
|
156
|
+
readonly description: "登录到 LyricNote";
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
readonly validation: {
|
|
160
|
+
readonly required: "{{field}}不能为空";
|
|
161
|
+
readonly invalid_email: "邮箱格式不正确";
|
|
162
|
+
readonly password_too_short: "密码至少需要{{count}}个字符";
|
|
163
|
+
readonly password_weak: "密码强度不够";
|
|
164
|
+
readonly passwords_not_match: "两次密码不一致";
|
|
165
|
+
};
|
|
166
|
+
readonly status: {
|
|
167
|
+
readonly loading: "加载中...";
|
|
168
|
+
readonly success: "操作成功";
|
|
169
|
+
readonly error: "操作失败";
|
|
170
|
+
readonly empty: "暂无数据";
|
|
171
|
+
readonly network_error: "网络错误,请稍后重试";
|
|
172
|
+
};
|
|
173
|
+
readonly errors: {
|
|
174
|
+
readonly network: "网络错误,请稍后重试";
|
|
175
|
+
readonly server: "服务器错误";
|
|
176
|
+
readonly unauthorized: "未授权,请先登录";
|
|
177
|
+
readonly not_found: "未找到相关内容";
|
|
178
|
+
readonly unknown: "未知错误";
|
|
179
|
+
};
|
|
180
|
+
readonly success: {
|
|
181
|
+
readonly saved: "保存成功";
|
|
182
|
+
readonly deleted: "删除成功";
|
|
183
|
+
readonly updated: "更新成功";
|
|
184
|
+
readonly created: "创建成功";
|
|
185
|
+
};
|
|
186
|
+
readonly language: {
|
|
187
|
+
readonly label: "语言";
|
|
188
|
+
readonly zh_cn: "简体中文";
|
|
189
|
+
readonly zh_tw: "繁體中文";
|
|
190
|
+
readonly en_us: "English";
|
|
191
|
+
readonly ja_jp: "日本語";
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* English translations
|
|
197
|
+
*/
|
|
198
|
+
declare const _default: {
|
|
199
|
+
readonly app: {
|
|
200
|
+
readonly name: "LyricNote";
|
|
201
|
+
readonly fullName: "LyricNote - Lyrics & Notes";
|
|
202
|
+
readonly icon: "🎵";
|
|
203
|
+
readonly description: "A powerful lyrics and notes management app";
|
|
204
|
+
readonly author: "LyricNote Team";
|
|
205
|
+
readonly copyright: `\u00A9 ${number} LyricNote`;
|
|
206
|
+
readonly version: "1.0.0";
|
|
207
|
+
};
|
|
208
|
+
readonly titles: {
|
|
209
|
+
readonly main: "🎵 LyricNote";
|
|
210
|
+
readonly admin: "LyricNote Admin";
|
|
211
|
+
readonly withVersion: "LyricNote v1.0.0";
|
|
212
|
+
readonly welcome: "Welcome to LyricNote";
|
|
213
|
+
readonly about: "About LyricNote";
|
|
214
|
+
};
|
|
215
|
+
readonly common: {
|
|
216
|
+
readonly hello: "Hello";
|
|
217
|
+
readonly welcome: "Welcome";
|
|
218
|
+
readonly confirm: "Confirm";
|
|
219
|
+
readonly cancel: "Cancel";
|
|
220
|
+
readonly save: "Save";
|
|
221
|
+
readonly delete: "Delete";
|
|
222
|
+
readonly edit: "Edit";
|
|
223
|
+
readonly back: "Back";
|
|
224
|
+
readonly next: "Next";
|
|
225
|
+
readonly submit: "Submit";
|
|
226
|
+
readonly finish: "Finish";
|
|
227
|
+
readonly loading: "Loading...";
|
|
228
|
+
readonly success: "Success";
|
|
229
|
+
readonly error: "Error";
|
|
230
|
+
readonly retry: "Retry";
|
|
231
|
+
readonly empty: "No data";
|
|
232
|
+
};
|
|
233
|
+
readonly nav: {
|
|
234
|
+
readonly home: "Home";
|
|
235
|
+
readonly lyrics: "Lyrics";
|
|
236
|
+
readonly create: "Create";
|
|
237
|
+
readonly collection: "Collection";
|
|
238
|
+
readonly profile: "Profile";
|
|
239
|
+
readonly settings: "Settings";
|
|
240
|
+
readonly history: "History";
|
|
241
|
+
readonly logout: "Logout";
|
|
242
|
+
};
|
|
243
|
+
readonly user: {
|
|
244
|
+
readonly login: "Login";
|
|
245
|
+
readonly register: "Register";
|
|
246
|
+
readonly username: "Username";
|
|
247
|
+
readonly password: "Password";
|
|
248
|
+
readonly email: "Email";
|
|
249
|
+
readonly phone: "Phone";
|
|
250
|
+
readonly nickname: "Nickname";
|
|
251
|
+
};
|
|
252
|
+
readonly pages: {
|
|
253
|
+
readonly home: {
|
|
254
|
+
readonly title: "Home";
|
|
255
|
+
readonly description: "A powerful lyrics and notes management app";
|
|
256
|
+
};
|
|
257
|
+
readonly profile: {
|
|
258
|
+
readonly title: "Profile";
|
|
259
|
+
readonly description: "Manage your personal information and preferences";
|
|
260
|
+
};
|
|
261
|
+
readonly admin: {
|
|
262
|
+
readonly title: "LyricNote Admin";
|
|
263
|
+
readonly description: "System management and data statistics";
|
|
264
|
+
};
|
|
265
|
+
readonly login: {
|
|
266
|
+
readonly title: "Login";
|
|
267
|
+
readonly description: "Login to LyricNote";
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
readonly validation: {
|
|
271
|
+
readonly required: "{{field}} is required";
|
|
272
|
+
readonly invalid_email: "Invalid email format";
|
|
273
|
+
readonly password_too_short: "Password must be at least {{count}} characters";
|
|
274
|
+
readonly password_weak: "Password is too weak";
|
|
275
|
+
readonly passwords_not_match: "Passwords do not match";
|
|
276
|
+
};
|
|
277
|
+
readonly status: {
|
|
278
|
+
readonly loading: "Loading...";
|
|
279
|
+
readonly success: "Success";
|
|
280
|
+
readonly error: "Error";
|
|
281
|
+
readonly empty: "No data";
|
|
282
|
+
readonly network_error: "Network error, please try again later";
|
|
283
|
+
};
|
|
284
|
+
readonly errors: {
|
|
285
|
+
readonly network: "Network error, please try again later";
|
|
286
|
+
readonly server: "Server error";
|
|
287
|
+
readonly unauthorized: "Unauthorized, please login first";
|
|
288
|
+
readonly not_found: "Not found";
|
|
289
|
+
readonly unknown: "Unknown error";
|
|
290
|
+
};
|
|
291
|
+
readonly success: {
|
|
292
|
+
readonly saved: "Saved successfully";
|
|
293
|
+
readonly deleted: "Deleted successfully";
|
|
294
|
+
readonly updated: "Updated successfully";
|
|
295
|
+
readonly created: "Created successfully";
|
|
296
|
+
};
|
|
297
|
+
readonly language: {
|
|
298
|
+
readonly label: "Language";
|
|
299
|
+
readonly zh_cn: "简体中文";
|
|
300
|
+
readonly zh_tw: "繁體中文";
|
|
301
|
+
readonly en_us: "English";
|
|
302
|
+
readonly ja_jp: "日本語";
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
export { type I18nAdapter, type I18nConfig, type I18nInstance, type Locale, type LocaleResources, type TranslateOptions, type TranslationKey, type TranslationValue, type Translations, createI18n, _default as enUS, getI18n, initI18n, t, useLocale, useTranslation, _default$1 as zhCN };
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
|
|
5
|
+
// src/i18n/i18n.ts
|
|
6
|
+
function defaultInterpolate(template, data) {
|
|
7
|
+
return template.replace(/\{\{(\w+)\}\}/g, (match, key) => {
|
|
8
|
+
return data[key]?.toString() ?? match;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function getNestedValue(obj, path) {
|
|
12
|
+
const keys = path.split(".");
|
|
13
|
+
let result = obj;
|
|
14
|
+
for (const key of keys) {
|
|
15
|
+
if (result && typeof result === "object" && key in result) {
|
|
16
|
+
result = result[key];
|
|
17
|
+
} else {
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
function createI18n(config) {
|
|
24
|
+
let currentLocale = config.locale;
|
|
25
|
+
const fallbackLocale = config.fallbackLocale || "zh-CN";
|
|
26
|
+
const resources = config.resources || {};
|
|
27
|
+
const interpolate = config.interpolate || defaultInterpolate;
|
|
28
|
+
function t2(key, options = {}) {
|
|
29
|
+
const { defaultValue, count, context = {} } = options;
|
|
30
|
+
let translation = getNestedValue(resources[currentLocale], key);
|
|
31
|
+
if (translation === void 0 && currentLocale !== fallbackLocale) {
|
|
32
|
+
translation = getNestedValue(resources[fallbackLocale], key);
|
|
33
|
+
}
|
|
34
|
+
if (translation === void 0) {
|
|
35
|
+
return defaultValue || key;
|
|
36
|
+
}
|
|
37
|
+
if (typeof translation !== "string") {
|
|
38
|
+
return JSON.stringify(translation);
|
|
39
|
+
}
|
|
40
|
+
if (count !== void 0) {
|
|
41
|
+
const pluralKey = count === 1 ? `${key}_one` : `${key}_other`;
|
|
42
|
+
const pluralTranslation = getNestedValue(resources[currentLocale], pluralKey);
|
|
43
|
+
if (pluralTranslation && typeof pluralTranslation === "string") {
|
|
44
|
+
translation = pluralTranslation;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const data = { ...context, count };
|
|
48
|
+
return interpolate(translation, data);
|
|
49
|
+
}
|
|
50
|
+
function setLocale(locale) {
|
|
51
|
+
currentLocale = locale;
|
|
52
|
+
}
|
|
53
|
+
function addResources(locale, newResources) {
|
|
54
|
+
if (!resources[locale]) {
|
|
55
|
+
resources[locale] = {};
|
|
56
|
+
}
|
|
57
|
+
resources[locale] = {
|
|
58
|
+
...resources[locale],
|
|
59
|
+
...newResources
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function getLocale() {
|
|
63
|
+
return currentLocale;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
locale: currentLocale,
|
|
67
|
+
t: t2,
|
|
68
|
+
setLocale,
|
|
69
|
+
addResources,
|
|
70
|
+
getLocale
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
var globalI18n = null;
|
|
74
|
+
function initI18n(config) {
|
|
75
|
+
globalI18n = createI18n(config);
|
|
76
|
+
return globalI18n;
|
|
77
|
+
}
|
|
78
|
+
function getI18n() {
|
|
79
|
+
if (!globalI18n) {
|
|
80
|
+
throw new Error("i18n not initialized. Call initI18n() first.");
|
|
81
|
+
}
|
|
82
|
+
return globalI18n;
|
|
83
|
+
}
|
|
84
|
+
function t(key, options) {
|
|
85
|
+
return getI18n().t(key, options);
|
|
86
|
+
}
|
|
87
|
+
function useTranslation() {
|
|
88
|
+
const i18n = getI18n();
|
|
89
|
+
const [locale, setLocaleState] = react.useState(i18n.getLocale());
|
|
90
|
+
const t2 = react.useCallback(
|
|
91
|
+
(key, options) => {
|
|
92
|
+
return i18n.t(key, options);
|
|
93
|
+
},
|
|
94
|
+
[locale]
|
|
95
|
+
// locale 改变时重新创建函数
|
|
96
|
+
);
|
|
97
|
+
const setLocale = react.useCallback((newLocale) => {
|
|
98
|
+
i18n.setLocale(newLocale);
|
|
99
|
+
setLocaleState(newLocale);
|
|
100
|
+
}, []);
|
|
101
|
+
return {
|
|
102
|
+
t: t2,
|
|
103
|
+
locale,
|
|
104
|
+
setLocale
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function useLocale() {
|
|
108
|
+
const i18n = getI18n();
|
|
109
|
+
const [locale, setLocaleState] = react.useState(i18n.getLocale());
|
|
110
|
+
const setLocale = react.useCallback((newLocale) => {
|
|
111
|
+
i18n.setLocale(newLocale);
|
|
112
|
+
setLocaleState(newLocale);
|
|
113
|
+
}, []);
|
|
114
|
+
return {
|
|
115
|
+
locale,
|
|
116
|
+
setLocale
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/i18n/locales/zh-CN.ts
|
|
121
|
+
var zh_CN_default = {
|
|
122
|
+
// ==================== 应用信息 ====================
|
|
123
|
+
app: {
|
|
124
|
+
name: "LyricNote",
|
|
125
|
+
fullName: "LyricNote - \u6B4C\u8BCD\u7B14\u8BB0",
|
|
126
|
+
icon: "\u{1F3B5}",
|
|
127
|
+
description: "\u4E00\u4E2A\u5F3A\u5927\u7684\u6B4C\u8BCD\u548C\u7B14\u8BB0\u7BA1\u7406\u5E94\u7528",
|
|
128
|
+
author: "LyricNote Team",
|
|
129
|
+
copyright: `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} LyricNote`,
|
|
130
|
+
version: "1.0.0"
|
|
131
|
+
},
|
|
132
|
+
// ==================== 应用标题 ====================
|
|
133
|
+
titles: {
|
|
134
|
+
main: "\u{1F3B5} LyricNote",
|
|
135
|
+
admin: "LyricNote \u7BA1\u7406\u540E\u53F0",
|
|
136
|
+
withVersion: "LyricNote v1.0.0",
|
|
137
|
+
welcome: "\u6B22\u8FCE\u4F7F\u7528 LyricNote",
|
|
138
|
+
about: "\u5173\u4E8E LyricNote"
|
|
139
|
+
},
|
|
140
|
+
// ==================== 通用文案 ====================
|
|
141
|
+
common: {
|
|
142
|
+
hello: "\u4F60\u597D",
|
|
143
|
+
welcome: "\u6B22\u8FCE",
|
|
144
|
+
confirm: "\u786E\u8BA4",
|
|
145
|
+
cancel: "\u53D6\u6D88",
|
|
146
|
+
save: "\u4FDD\u5B58",
|
|
147
|
+
delete: "\u5220\u9664",
|
|
148
|
+
edit: "\u7F16\u8F91",
|
|
149
|
+
back: "\u8FD4\u56DE",
|
|
150
|
+
next: "\u4E0B\u4E00\u6B65",
|
|
151
|
+
submit: "\u63D0\u4EA4",
|
|
152
|
+
finish: "\u5B8C\u6210",
|
|
153
|
+
loading: "\u52A0\u8F7D\u4E2D...",
|
|
154
|
+
success: "\u64CD\u4F5C\u6210\u529F",
|
|
155
|
+
error: "\u64CD\u4F5C\u5931\u8D25",
|
|
156
|
+
retry: "\u91CD\u8BD5",
|
|
157
|
+
empty: "\u6682\u65E0\u6570\u636E"
|
|
158
|
+
},
|
|
159
|
+
// ==================== 导航菜单 ====================
|
|
160
|
+
nav: {
|
|
161
|
+
home: "\u9996\u9875",
|
|
162
|
+
lyrics: "\u6B4C\u8BCD",
|
|
163
|
+
create: "\u521B\u4F5C",
|
|
164
|
+
collection: "\u6536\u85CF",
|
|
165
|
+
profile: "\u6211\u7684",
|
|
166
|
+
settings: "\u8BBE\u7F6E",
|
|
167
|
+
history: "\u5386\u53F2",
|
|
168
|
+
logout: "\u9000\u51FA\u767B\u5F55"
|
|
169
|
+
},
|
|
170
|
+
// ==================== 用户相关 ====================
|
|
171
|
+
user: {
|
|
172
|
+
login: "\u767B\u5F55",
|
|
173
|
+
register: "\u6CE8\u518C",
|
|
174
|
+
username: "\u7528\u6237\u540D",
|
|
175
|
+
password: "\u5BC6\u7801",
|
|
176
|
+
email: "\u90AE\u7BB1",
|
|
177
|
+
phone: "\u624B\u673A\u53F7",
|
|
178
|
+
nickname: "\u6635\u79F0"
|
|
179
|
+
},
|
|
180
|
+
// ==================== 页面标题和描述 ====================
|
|
181
|
+
pages: {
|
|
182
|
+
home: {
|
|
183
|
+
title: "\u9996\u9875",
|
|
184
|
+
description: "\u4E00\u4E2A\u5F3A\u5927\u7684\u6B4C\u8BCD\u548C\u7B14\u8BB0\u7BA1\u7406\u5E94\u7528"
|
|
185
|
+
},
|
|
186
|
+
profile: {
|
|
187
|
+
title: "\u4E2A\u4EBA\u4E2D\u5FC3",
|
|
188
|
+
description: "\u7BA1\u7406\u60A8\u7684\u4E2A\u4EBA\u4FE1\u606F\u548C\u504F\u597D\u8BBE\u7F6E"
|
|
189
|
+
},
|
|
190
|
+
admin: {
|
|
191
|
+
title: "LyricNote \u7BA1\u7406\u540E\u53F0",
|
|
192
|
+
description: "\u7CFB\u7EDF\u7BA1\u7406\u548C\u6570\u636E\u7EDF\u8BA1"
|
|
193
|
+
},
|
|
194
|
+
login: {
|
|
195
|
+
title: "\u767B\u5F55",
|
|
196
|
+
description: "\u767B\u5F55\u5230 LyricNote"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
// ==================== 表单验证 ====================
|
|
200
|
+
validation: {
|
|
201
|
+
required: "{{field}}\u4E0D\u80FD\u4E3A\u7A7A",
|
|
202
|
+
invalid_email: "\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E",
|
|
203
|
+
password_too_short: "\u5BC6\u7801\u81F3\u5C11\u9700\u8981{{count}}\u4E2A\u5B57\u7B26",
|
|
204
|
+
password_weak: "\u5BC6\u7801\u5F3A\u5EA6\u4E0D\u591F",
|
|
205
|
+
passwords_not_match: "\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4"
|
|
206
|
+
},
|
|
207
|
+
// ==================== 状态提示 ====================
|
|
208
|
+
status: {
|
|
209
|
+
loading: "\u52A0\u8F7D\u4E2D...",
|
|
210
|
+
success: "\u64CD\u4F5C\u6210\u529F",
|
|
211
|
+
error: "\u64CD\u4F5C\u5931\u8D25",
|
|
212
|
+
empty: "\u6682\u65E0\u6570\u636E",
|
|
213
|
+
network_error: "\u7F51\u7EDC\u9519\u8BEF\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"
|
|
214
|
+
},
|
|
215
|
+
// ==================== 错误消息 ====================
|
|
216
|
+
errors: {
|
|
217
|
+
network: "\u7F51\u7EDC\u9519\u8BEF\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",
|
|
218
|
+
server: "\u670D\u52A1\u5668\u9519\u8BEF",
|
|
219
|
+
unauthorized: "\u672A\u6388\u6743\uFF0C\u8BF7\u5148\u767B\u5F55",
|
|
220
|
+
not_found: "\u672A\u627E\u5230\u76F8\u5173\u5185\u5BB9",
|
|
221
|
+
unknown: "\u672A\u77E5\u9519\u8BEF"
|
|
222
|
+
},
|
|
223
|
+
// ==================== 成功消息 ====================
|
|
224
|
+
success: {
|
|
225
|
+
saved: "\u4FDD\u5B58\u6210\u529F",
|
|
226
|
+
deleted: "\u5220\u9664\u6210\u529F",
|
|
227
|
+
updated: "\u66F4\u65B0\u6210\u529F",
|
|
228
|
+
created: "\u521B\u5EFA\u6210\u529F"
|
|
229
|
+
},
|
|
230
|
+
// ==================== 语言设置 ====================
|
|
231
|
+
language: {
|
|
232
|
+
label: "\u8BED\u8A00",
|
|
233
|
+
zh_cn: "\u7B80\u4F53\u4E2D\u6587",
|
|
234
|
+
zh_tw: "\u7E41\u9AD4\u4E2D\u6587",
|
|
235
|
+
en_us: "English",
|
|
236
|
+
ja_jp: "\u65E5\u672C\u8A9E"
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// src/i18n/locales/en-US.ts
|
|
241
|
+
var en_US_default = {
|
|
242
|
+
// ==================== App Information ====================
|
|
243
|
+
app: {
|
|
244
|
+
name: "LyricNote",
|
|
245
|
+
fullName: "LyricNote - Lyrics & Notes",
|
|
246
|
+
icon: "\u{1F3B5}",
|
|
247
|
+
description: "A powerful lyrics and notes management app",
|
|
248
|
+
author: "LyricNote Team",
|
|
249
|
+
copyright: `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} LyricNote`,
|
|
250
|
+
version: "1.0.0"
|
|
251
|
+
},
|
|
252
|
+
// ==================== App Titles ====================
|
|
253
|
+
titles: {
|
|
254
|
+
main: "\u{1F3B5} LyricNote",
|
|
255
|
+
admin: "LyricNote Admin",
|
|
256
|
+
withVersion: "LyricNote v1.0.0",
|
|
257
|
+
welcome: "Welcome to LyricNote",
|
|
258
|
+
about: "About LyricNote"
|
|
259
|
+
},
|
|
260
|
+
// ==================== Common ====================
|
|
261
|
+
common: {
|
|
262
|
+
hello: "Hello",
|
|
263
|
+
welcome: "Welcome",
|
|
264
|
+
confirm: "Confirm",
|
|
265
|
+
cancel: "Cancel",
|
|
266
|
+
save: "Save",
|
|
267
|
+
delete: "Delete",
|
|
268
|
+
edit: "Edit",
|
|
269
|
+
back: "Back",
|
|
270
|
+
next: "Next",
|
|
271
|
+
submit: "Submit",
|
|
272
|
+
finish: "Finish",
|
|
273
|
+
loading: "Loading...",
|
|
274
|
+
success: "Success",
|
|
275
|
+
error: "Error",
|
|
276
|
+
retry: "Retry",
|
|
277
|
+
empty: "No data"
|
|
278
|
+
},
|
|
279
|
+
// ==================== Navigation ====================
|
|
280
|
+
nav: {
|
|
281
|
+
home: "Home",
|
|
282
|
+
lyrics: "Lyrics",
|
|
283
|
+
create: "Create",
|
|
284
|
+
collection: "Collection",
|
|
285
|
+
profile: "Profile",
|
|
286
|
+
settings: "Settings",
|
|
287
|
+
history: "History",
|
|
288
|
+
logout: "Logout"
|
|
289
|
+
},
|
|
290
|
+
// ==================== User ====================
|
|
291
|
+
user: {
|
|
292
|
+
login: "Login",
|
|
293
|
+
register: "Register",
|
|
294
|
+
username: "Username",
|
|
295
|
+
password: "Password",
|
|
296
|
+
email: "Email",
|
|
297
|
+
phone: "Phone",
|
|
298
|
+
nickname: "Nickname"
|
|
299
|
+
},
|
|
300
|
+
// ==================== Pages ====================
|
|
301
|
+
pages: {
|
|
302
|
+
home: {
|
|
303
|
+
title: "Home",
|
|
304
|
+
description: "A powerful lyrics and notes management app"
|
|
305
|
+
},
|
|
306
|
+
profile: {
|
|
307
|
+
title: "Profile",
|
|
308
|
+
description: "Manage your personal information and preferences"
|
|
309
|
+
},
|
|
310
|
+
admin: {
|
|
311
|
+
title: "LyricNote Admin",
|
|
312
|
+
description: "System management and data statistics"
|
|
313
|
+
},
|
|
314
|
+
login: {
|
|
315
|
+
title: "Login",
|
|
316
|
+
description: "Login to LyricNote"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
// ==================== Form Validation ====================
|
|
320
|
+
validation: {
|
|
321
|
+
required: "{{field}} is required",
|
|
322
|
+
invalid_email: "Invalid email format",
|
|
323
|
+
password_too_short: "Password must be at least {{count}} characters",
|
|
324
|
+
password_weak: "Password is too weak",
|
|
325
|
+
passwords_not_match: "Passwords do not match"
|
|
326
|
+
},
|
|
327
|
+
// ==================== Status Messages ====================
|
|
328
|
+
status: {
|
|
329
|
+
loading: "Loading...",
|
|
330
|
+
success: "Success",
|
|
331
|
+
error: "Error",
|
|
332
|
+
empty: "No data",
|
|
333
|
+
network_error: "Network error, please try again later"
|
|
334
|
+
},
|
|
335
|
+
// ==================== Error Messages ====================
|
|
336
|
+
errors: {
|
|
337
|
+
network: "Network error, please try again later",
|
|
338
|
+
server: "Server error",
|
|
339
|
+
unauthorized: "Unauthorized, please login first",
|
|
340
|
+
not_found: "Not found",
|
|
341
|
+
unknown: "Unknown error"
|
|
342
|
+
},
|
|
343
|
+
// ==================== Success Messages ====================
|
|
344
|
+
success: {
|
|
345
|
+
saved: "Saved successfully",
|
|
346
|
+
deleted: "Deleted successfully",
|
|
347
|
+
updated: "Updated successfully",
|
|
348
|
+
created: "Created successfully"
|
|
349
|
+
},
|
|
350
|
+
// ==================== Language Settings ====================
|
|
351
|
+
language: {
|
|
352
|
+
label: "Language",
|
|
353
|
+
zh_cn: "\u7B80\u4F53\u4E2D\u6587",
|
|
354
|
+
zh_tw: "\u7E41\u9AD4\u4E2D\u6587",
|
|
355
|
+
en_us: "English",
|
|
356
|
+
ja_jp: "\u65E5\u672C\u8A9E"
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
exports.createI18n = createI18n;
|
|
361
|
+
exports.enUS = en_US_default;
|
|
362
|
+
exports.getI18n = getI18n;
|
|
363
|
+
exports.initI18n = initI18n;
|
|
364
|
+
exports.t = t;
|
|
365
|
+
exports.useLocale = useLocale;
|
|
366
|
+
exports.useTranslation = useTranslation;
|
|
367
|
+
exports.zhCN = zh_CN_default;
|
|
368
|
+
//# sourceMappingURL=index.js.map
|
|
369
|
+
//# sourceMappingURL=index.js.map
|