@tplc/wot 0.1.8 → 0.1.10

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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.10](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.25...v0.1.10) (2024-09-25)
6
+
7
+ ### [0.1.9](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.8...v0.1.9) (2024-09-25)
8
+
9
+
10
+ ### ✨ Features | 新功能
11
+
12
+ * update version ([7197c50](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7197c509ec1c724b2741bf433a78655a38589d81))
13
+ * 支持切换语言 ([e012e82](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/e012e820180f29159b23f5ce13007a78b85277d8))
14
+
5
15
  ### [0.1.8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.22...v0.1.8) (2024-09-24)
6
16
 
7
17
  ### [0.1.7](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.0.20...v0.1.7) (2024-09-22)
package/locale/index.ts CHANGED
@@ -9,14 +9,22 @@
9
9
  */
10
10
  import { reactive, ref } from 'vue'
11
11
  import zhCN from './lang/zh-CN'
12
+ import enUs from './lang/en-US'
12
13
  import { deepAssign } from '../components/common/util'
13
14
 
14
15
  type Message = Record<string, any>
15
16
  type Messages = Record<string, Message>
17
+ export const setLangStorage = (lang: string) => {
18
+ uni.setStorageSync('lang', lang)
19
+ }
20
+ export const getLangStorage = () => {
21
+ return uni.getStorageSync('lang') || 'zh-CN'
22
+ }
16
23
 
17
- const lang = ref<string>('zh-CN')
24
+ const lang = ref<string>(getLangStorage())
18
25
  const messages = reactive<Messages>({
19
26
  'zh-CN': zhCN,
27
+ 'en-US': enUs,
20
28
  })
21
29
 
22
30
  export const Locale = {
@@ -29,11 +37,15 @@ export const Locale = {
29
37
  if (newMessage) {
30
38
  this.add({ [newLang]: newMessage })
31
39
  }
40
+ setLangStorage(newLang)
32
41
  },
33
42
 
34
43
  add(newMessages: Messages = {}) {
35
44
  deepAssign(messages, newMessages)
36
45
  },
46
+ getLang() {
47
+ return lang.value
48
+ },
37
49
  }
38
50
 
39
51
  export const useCurrentLang = () => lang
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "@tplc/wot",
3
3
  "name": "@tplc/wot",
4
- "version": "0.1.8",
4
+ "version": "0.1.10",
5
5
  "keywords": [
6
6
  "wot-design-uni",
7
7
  "国际化",
@@ -161,8 +161,8 @@ declare const _default: __VLS_WithTemplateSlots<
161
161
  {
162
162
  customStyle: string
163
163
  customClass: string
164
- border: boolean
165
164
  index: boolean | Omit<Partial<TableColumnProps>, 'prop'>
165
+ border: boolean
166
166
  ellipsis: boolean
167
167
  height: string
168
168
  stripe: boolean
@@ -1,9 +1,12 @@
1
1
  type Message = Record<string, any>
2
2
  type Messages = Record<string, Message>
3
+ export declare const setLangStorage: (lang: string) => void
4
+ export declare const getLangStorage: () => any
3
5
  export declare const Locale: {
4
6
  messages(): Message
5
7
  use(newLang: string, newMessage?: Message): void
6
8
  add(newMessages?: Messages): void
9
+ getLang(): string
7
10
  }
8
11
  export declare const useCurrentLang: () => import('vue').Ref<string>
9
12
  export default Locale
@@ -0,0 +1,128 @@
1
+ declare const _default: {
2
+ calendar: {
3
+ placeholder: string
4
+ title: string
5
+ day: string
6
+ week: string
7
+ month: string
8
+ confirm: string
9
+ startTime: string
10
+ endTime: string
11
+ to: string
12
+ timeFormat: string
13
+ dateFormat: string
14
+ weekFormat: (year: number, week: number) => string
15
+ startWeek: string
16
+ endWeek: string
17
+ startMonth: string
18
+ endMonth: string
19
+ monthFormat: string
20
+ }
21
+ calendarView: {
22
+ startTime: string
23
+ endTime: string
24
+ weeks: {
25
+ sun: string
26
+ mon: string
27
+ tue: string
28
+ wed: string
29
+ thu: string
30
+ fri: string
31
+ sat: string
32
+ }
33
+ rangePrompt: (maxRange: number) => string
34
+ rangePromptWeek: (maxRange: number) => string
35
+ rangePromptMonth: (maxRange: number) => string
36
+ monthTitle: string
37
+ yearTitle: string
38
+ month: string
39
+ hour: (value: number) => string
40
+ minute: (value: number) => string
41
+ second: (value: number) => string
42
+ }
43
+ datetimePicker: {
44
+ start: string
45
+ end: string
46
+ to: string
47
+ placeholder: string
48
+ confirm: string
49
+ cancel: string
50
+ }
51
+ collapse: {
52
+ expand: string
53
+ retract: string
54
+ }
55
+ colPicker: {
56
+ title: string
57
+ placeholder: string
58
+ select: string
59
+ }
60
+ loadmore: {
61
+ loading: string
62
+ finished: string
63
+ error: string
64
+ retry: string
65
+ }
66
+ imgCropper: {
67
+ confirm: string
68
+ cancel: string
69
+ }
70
+ messageBox: {
71
+ inputPlaceholder: string
72
+ confirm: string
73
+ cancel: string
74
+ inputNoValidate: string
75
+ }
76
+ numberKeyboard: {
77
+ confirm: string
78
+ }
79
+ pagination: {
80
+ prev: string
81
+ next: string
82
+ page: (value: number) => string
83
+ total: (total: number) => string
84
+ size: (size: number) => string
85
+ }
86
+ picker: {
87
+ cancel: string
88
+ done: string
89
+ placeholder: string
90
+ }
91
+ search: {
92
+ search: string
93
+ cancel: string
94
+ }
95
+ steps: {
96
+ wait: string
97
+ finished: string
98
+ process: string
99
+ failed: string
100
+ }
101
+ tabs: {
102
+ all: string
103
+ }
104
+ upload: {
105
+ error: string
106
+ }
107
+ input: {
108
+ placeholder: string
109
+ }
110
+ selectPicker: {
111
+ title: string
112
+ placeholder: string
113
+ select: string
114
+ confirm: string
115
+ filterPlaceholder: string
116
+ }
117
+ tag: {
118
+ placeholder: string
119
+ add: string
120
+ }
121
+ textarea: {
122
+ placeholder: string
123
+ }
124
+ tableCol: {
125
+ indexLabel: string
126
+ }
127
+ }
128
+ export default _default