MCPcopy
hub / github.com/youzan/vant / initDemoLocale

Function initDemoLocale

packages/vant/docs/site/use-translate.ts:15–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15export function initDemoLocale() {
16 Locale.add({
17 'en-US': enUS,
18 });
19
20 // switch lang after routing
21 if (inBrowser && window.vueRouter) {
22 window.vueRouter.afterEach((to) => {
23 const { lang } = to.meta || {};
24
25 if (lang) {
26 Locale.use(lang as string);
27 }
28 });
29 }
30
31 // add some basic locale messages
32 Locale.add({
33 'zh-CN': {
34 add: '增加',
35 red: '红色',
36 tab: '标签',
37 tag: '标签',
38 desc: '描述信息',
39 back: '返回',
40 title: '标题',
41 status: '状态',
42 button: '按钮',
43 option: '选项',
44 search: '搜索',
45 orange: '橙色',
46 yellow: '黄色',
47 purple: '紫色',
48 custom: '自定义',
49 content: '内容',
50 username: '用户名',
51 password: '密码',
52 decrease: '减少',
53 disabled: '禁用状态',
54 uneditable: '不可编辑',
55 basicUsage: '基础用法',
56 usingUrl: '使用图片 URL',
57 advancedUsage: '高级用法',
58 loadingStatus: '加载状态',
59 },
60 'en-US': {
61 add: 'Add',
62 red: 'Red',
63 tab: 'Tab',
64 tag: 'Tag',
65 desc: 'Description',
66 back: 'Back',
67 title: 'Title',
68 status: 'Status',
69 button: 'Button',
70 option: 'Option',
71 search: 'Search',
72 orange: 'Orange',

Callers 2

demo.tsFile · 0.90
use-translate.tsFile · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…