@gm-pc/locales 1.24.9-beta.13 → 1.24.9-beta.15

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/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- type language = 'zh' | 'zh-HK' | 'en' | 'th'
2
-
3
- declare function getLocale(word: string): string
4
-
5
- declare function setLocale(language: language): void
6
-
7
- declare function setLocaleAndStorage(language: language): void
8
-
9
- export { getLocale, setLocale, setLocaleAndStorage }
1
+ type language = 'zh' | 'zh-HK' | 'en' | 'th'
2
+
3
+ declare function getLocale(word: string): string
4
+
5
+ declare function setLocale(language: language): void
6
+
7
+ declare function setLocaleAndStorage(language: language): void
8
+
9
+ export { getLocale, setLocale, setLocaleAndStorage }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gm-pc/locales",
3
- "version": "1.24.9-beta.13",
3
+ "version": "1.24.9-beta.15",
4
4
  "description": "",
5
5
  "author": "liyatang <liyatang@qq.com>",
6
6
  "homepage": "https://github.com/gmfe/gm-pc#readme",
@@ -20,5 +20,5 @@
20
20
  "bugs": {
21
21
  "url": "https://github.com/gmfe/gm-pc/issues"
22
22
  },
23
- "gitHead": "b773c85a7a6d591837f7f90058bbbc3c596f5a8c"
23
+ "gitHead": "f14d1b143c889ae2e2bc447893bd88e47af14b77"
24
24
  }
package/src/index.js CHANGED
@@ -1,36 +1,36 @@
1
- /* 此文件由脚本自动生成 */
2
- import lng1 from './lng/zh.json'
3
- import lng2 from './lng/zh-HK.json'
4
- import lng3 from './lng/en.json'
5
- import lng4 from './lng/th.json'
6
-
7
- const LOCALES_LNG = '_gm-pc_locales_lng_'
8
- const moduleMap = {
9
- zh: lng1,
10
- 'zh-HK': lng2,
11
- en: lng3,
12
- th: lng4,
13
- }
14
- let _language = window.localStorage.getItem(LOCALES_LNG) || 'zh'
15
-
16
- const setLocaleAndStorage = (lng) => {
17
- setLocale(lng)
18
- window.localStorage.setItem(LOCALES_LNG, lng)
19
- }
20
-
21
- const setLocale = (lng) => {
22
- _language = lng
23
- }
24
-
25
- const getLocale = (text) => {
26
- const languageMap = moduleMap[_language] || moduleMap.zh
27
- let result = languageMap[text]
28
-
29
- if (!result) {
30
- result = text.split('__').pop()
31
- }
32
-
33
- return result
34
- }
35
-
36
- export { getLocale, setLocale, setLocaleAndStorage }
1
+ /* 此文件由脚本自动生成 */
2
+ import lng1 from './lng/zh.json'
3
+ import lng2 from './lng/zh-HK.json'
4
+ import lng3 from './lng/en.json'
5
+ import lng4 from './lng/th.json'
6
+
7
+ const LOCALES_LNG = '_gm-pc_locales_lng_'
8
+ const moduleMap = {
9
+ zh: lng1,
10
+ 'zh-HK': lng2,
11
+ en: lng3,
12
+ th: lng4,
13
+ }
14
+ let _language = window.localStorage.getItem(LOCALES_LNG) || 'zh'
15
+
16
+ const setLocaleAndStorage = (lng) => {
17
+ setLocale(lng)
18
+ window.localStorage.setItem(LOCALES_LNG, lng)
19
+ }
20
+
21
+ const setLocale = (lng) => {
22
+ _language = lng
23
+ }
24
+
25
+ const getLocale = (text) => {
26
+ const languageMap = moduleMap[_language] || moduleMap.zh
27
+ let result = languageMap[text]
28
+
29
+ if (!result) {
30
+ result = text.split('__').pop()
31
+ }
32
+
33
+ return result
34
+ }
35
+
36
+ export { getLocale, setLocale, setLocaleAndStorage }
package/src/lng/en.json CHANGED
@@ -1,89 +1,108 @@
1
- {
2
- "1月": "Jan",
3
- "2月": "Feb",
4
- "3月": "Mar",
5
- "4月": "Apr",
6
- "5月": "May",
7
- "6月": "Jun",
8
- "7月": "Jul",
9
- "8月": "Aug",
10
- "9月": "Sep",
11
- "10月": "Oct",
12
- "11月": "Nov",
13
- "12月": "Dec",
14
- "week__日": "Su",
15
- "week__一": "Mo",
16
- "week__二": "Tu",
17
- "week__三": "We",
18
- "week__四": "Th",
19
- "week__五": "Fr",
20
- "week__六": "Sa",
21
- "提示": "Tips",
22
- "取消": "Cancel",
23
- "确定": "OK",
24
- "操作": "Operation",
25
- "保存": "Save",
26
- "确认": "OK",
27
- "没有更多数据了": "No data here",
28
- "上一页": "Previous",
29
- "下一页": "Next",
30
- "显示": "Show",
31
- "": "A total of",
32
- "": "items",
33
- "收拢详细信息": "Collapse details",
34
- "展开详细信息": "Expand details",
35
- "已选中所有": "",
36
- "全选": "Select all",
37
- "待选择": "ItemsSource",
38
- "搜索": "Search",
39
- "已选择": "Target",
40
- "请填写": "Please enter",
41
- "请填写邮件地址": "Please enter email address",
42
- "请填写网址": "Please enter URL",
43
- "请填写数字": "Please enter number",
44
- "请填写正数": "Please enter positive number",
45
- "请填写字母或数字": "Please enter number or letter",
46
- "表头设置": "Table header setting",
47
- "勾选当前页内容": "Check the current page",
48
- "勾选所有页内容": "Check all page content",
49
- "": "items",
50
- "详情": "Details",
51
- "删除": "Delete",
52
- "编辑": "Edit",
53
- "自定义颜色": "Custom colors",
54
- "红色": "Red",
55
- "橙色": "Orange",
56
- "黄色": "Yellow",
57
- "绿色": "Green",
58
- "蓝色": "Blue",
59
- "紫色": "Purple",
60
- "灰色": "Gray",
61
- "全部": "All",
62
- "更多功能": "More function",
63
- "高级筛选": "Advanced screening",
64
- "可选字段": "Optional field",
65
- "当前选定字段": "The currently selected field",
66
- "下一步": "Next step",
67
- "马上尝试": "Try it now",
68
- "确定删除?": "Are you sure to delete?",
69
- "加载数据中...": "Loading data",
70
- "没有数据了": "There's no data left",
71
- "所有": "All",
72
- "取消批量勾选": "Cancel batch selection",
73
- "定位信息": "locate information",
74
- "编辑头像": "Edit profile picture",
75
- "预览": "Preview",
76
- "收起": "Retract",
77
- "昨天": "Yesterday",
78
- "今天": "Today",
79
- "近7天": "In the past 7 days",
80
- "近30天": "In the past 30 days",
81
- "上个月": "last month",
82
- "开始日期": "Start date",
83
- "结束日期": "End Date",
84
- "我已阅读以上提示,确认删除": "I have read the above prompts and confirm the deletion",
85
- "展开": "expand",
86
- "更多设置": "More settings",
87
- "没有数据": "No data",
88
- "+ 加图": "+Add a picture"
89
- }
1
+ {
2
+ "1月": "Jan",
3
+ "2月": "Feb",
4
+ "3月": "Mar",
5
+ "4月": "Apr",
6
+ "5月": "May",
7
+ "6月": "Jun",
8
+ "7月": "Jul",
9
+ "8月": "Aug",
10
+ "9月": "Sep",
11
+ "10月": "Oct",
12
+ "11月": "Nov",
13
+ "12月": "Dec",
14
+ "01月": "Jan",
15
+ "02月": "Feb",
16
+ "03月": "Mar",
17
+ "04月": "Apr",
18
+ "05月": "May",
19
+ "06月": "Jun",
20
+ "07月": "Jul",
21
+ "08月": "Aug",
22
+ "09月": "Sep",
23
+ "week__日": "Su",
24
+ "week__一": "Mo",
25
+ "week__二": "Tu",
26
+ "week__三": "We",
27
+ "week__四": "Th",
28
+ "week__五": "Fr",
29
+ "week__六": "Sa",
30
+ "提示": "Tips",
31
+ "取消": "Cancel",
32
+ "确定": "OK",
33
+ "操作": "Operation",
34
+ "保存": "Save",
35
+ "确认": "OK",
36
+ "没有更多数据了": "No data here",
37
+ "上一页": "Previous",
38
+ "下一页": "Next",
39
+ "显示": "Show",
40
+ "": "Total ",
41
+ "": " items",
42
+ "收拢详细信息": "Collapse details",
43
+ "展开详细信息": "Expand details",
44
+ "已选中所有": "",
45
+ "全选": "Select all",
46
+ "待选择": "ItemsSource",
47
+ "搜索": "Search",
48
+ "已选择": "Target",
49
+ "请填写": "Please enter",
50
+ "请填写邮件地址": "Please enter email address",
51
+ "请填写网址": "Please enter URL",
52
+ "请填写数字": "Please enter number",
53
+ "请填写正数": "Please enter positive number",
54
+ "请填写字母或数字": "Please enter number or letter",
55
+ "表头设置": "Table header setting",
56
+ "勾选当前页内容": "Check the current page",
57
+ "勾选所有页内容": "Check all page content",
58
+ "": "items",
59
+ "详情": "Details",
60
+ "删除": "Delete",
61
+ "编辑": "Edit",
62
+ "自定义颜色": "Custom colors",
63
+ "红色": "Red",
64
+ "橙色": "Orange",
65
+ "黄色": "Yellow",
66
+ "绿色": "Green",
67
+ "蓝色": "Blue",
68
+ "紫色": "Purple",
69
+ "灰色": "Gray",
70
+ "全部": "All",
71
+ "更多功能": "More function",
72
+ "高级筛选": "Advanced screening",
73
+ "可选字段": "Optional field",
74
+ "当前选定字段": "The currently selected field",
75
+ "下一步": "Next step",
76
+ "马上尝试": "Try it now",
77
+ "确定删除?": "Are you sure to delete?",
78
+ "加载数据中...": "Loading data...",
79
+ "没有数据了": "There's no data left",
80
+ "所有": "All",
81
+ "取消批量勾选": "Cancel batch selection",
82
+ "定位信息": "locate information",
83
+ "编辑头像": "Edit profile picture",
84
+ "预览": "Preview",
85
+ "收起": "Retract",
86
+ "昨天": "Yesterday",
87
+ "今天": "Today",
88
+ "近7天": "Last 7 days",
89
+ "近30天": "Last 30 days",
90
+ "上个月": "Last month",
91
+ "开始日期": "Start date",
92
+ "结束日期": "End Date",
93
+ "我已阅读以上提示,确认删除": "I have read the above prompts and confirm the deletion",
94
+ "展开": "Expand",
95
+ "更多设置": "More settings",
96
+ "没有数据": "No data",
97
+ "+ 加图": "+Add a picture",
98
+ "年": "Year",
99
+ "关闭": "Close",
100
+ "打开": "Open",
101
+ "limit最小为1": "The minimum limit is 1",
102
+ "注意:rowSelect使用过程中不能修改": "Note: rowSelect cannot be modified during use",
103
+ "输入sku名称": "Enter SKU name",
104
+ "添加": "Add",
105
+ "序号": "Index",
106
+ "条记录": " items",
107
+ "每页": "page"
108
+ }
package/src/lng/th.json CHANGED
@@ -1,49 +1,49 @@
1
- {
2
- "1月": "",
3
- "2月": "",
4
- "3月": "",
5
- "4月": "",
6
- "5月": "",
7
- "6月": "",
8
- "7月": "",
9
- "8月": "",
10
- "9月": "",
11
- "10月": "",
12
- "11月": "",
13
- "12月": "",
14
- "week__日": "",
15
- "week__一": "",
16
- "week__二": "",
17
- "week__三": "",
18
- "week__四": "",
19
- "week__五": "",
20
- "week__六": "",
21
- "提示": "",
22
- "取消": "",
23
- "确定": "",
24
- "操作": "",
25
- "保存": "",
26
- "确认": "",
27
- "没有数据": "",
28
- "上一页": "",
29
- "下一页": "",
30
- "显示": "",
31
- "共": "",
32
- "条": "",
33
- "收拢详细信息": "",
34
- "展开详细信息": "",
35
- "已选中所有": "",
36
- "全选": "",
37
- "待选择": "",
38
- "搜索": "",
39
- "已选择": "",
40
- "请填写": "",
41
- "请填写邮件地址": "",
42
- "请填写网址": "",
43
- "请填写数字": "",
44
- "请填写正数": "",
45
- "请填写字母或数字": "",
46
- "详情": "",
47
- "删除": "",
48
- "编辑": ""
49
- }
1
+ {
2
+ "1月": "",
3
+ "2月": "",
4
+ "3月": "",
5
+ "4月": "",
6
+ "5月": "",
7
+ "6月": "",
8
+ "7月": "",
9
+ "8月": "",
10
+ "9月": "",
11
+ "10月": "",
12
+ "11月": "",
13
+ "12月": "",
14
+ "week__日": "",
15
+ "week__一": "",
16
+ "week__二": "",
17
+ "week__三": "",
18
+ "week__四": "",
19
+ "week__五": "",
20
+ "week__六": "",
21
+ "提示": "",
22
+ "取消": "",
23
+ "确定": "",
24
+ "操作": "",
25
+ "保存": "",
26
+ "确认": "",
27
+ "没有数据": "",
28
+ "上一页": "",
29
+ "下一页": "",
30
+ "显示": "",
31
+ "共": "",
32
+ "条": "",
33
+ "收拢详细信息": "",
34
+ "展开详细信息": "",
35
+ "已选中所有": "",
36
+ "全选": "",
37
+ "待选择": "",
38
+ "搜索": "",
39
+ "已选择": "",
40
+ "请填写": "",
41
+ "请填写邮件地址": "",
42
+ "请填写网址": "",
43
+ "请填写数字": "",
44
+ "请填写正数": "",
45
+ "请填写字母或数字": "",
46
+ "详情": "",
47
+ "删除": "",
48
+ "编辑": ""
49
+ }
@@ -1,57 +1,57 @@
1
- {
2
- "1月": "1月",
3
- "2月": "2月",
4
- "3月": "3月",
5
- "4月": "4月",
6
- "5月": "5月",
7
- "6月": "6月",
8
- "7月": "7月",
9
- "8月": "8月",
10
- "9月": "9月",
11
- "10月": "10月",
12
- "11月": "11月",
13
- "12月": "12月",
14
- "week__日": "日",
15
- "week__一": "一",
16
- "week__二": "二",
17
- "week__三": "三",
18
- "week__四": "四",
19
- "week__五": "五",
20
- "week__六": "六",
21
- "提示": "提示",
22
- "取消": "取消",
23
- "确定": "確定",
24
- "操作": "操作",
25
- "保存": "保存",
26
- "确认": "確認",
27
- "没有更多数据了": "沒有更多數據了",
28
- "上一页": "上一頁",
29
- "下一页": "下一頁",
30
- "显示": "顯示",
31
- "共": "共",
32
- "条": "條",
33
- "收拢详细信息": "收攏詳細信息",
34
- "展开详细信息": "展開詳細信息",
35
- "已选中所有": "已選中所有",
36
- "全选": "全選",
37
- "待选择": "待選擇",
38
- "搜索": "搜索",
39
- "已选择": "已選擇",
40
- "请填写": "請填寫",
41
- "请填写邮件地址": "請填寫郵件地址",
42
- "请填写网址": "請填寫網址",
43
- "请填写数字": "請填寫數字",
44
- "请填写正数": "請填寫正數",
45
- "请填写字母或数字": "請填寫字母或數字",
46
- "详情": "詳情",
47
- "删除": "刪除",
48
- "编辑": "編輯",
49
- "自定义颜色": "自定義顏色",
50
- "红色": "紅色",
51
- "橙色": "橙色",
52
- "黄色": "黃色",
53
- "绿色": "綠色",
54
- "蓝色": "藍色",
55
- "紫色": "紫色",
56
- "灰色": "灰色"
57
- }
1
+ {
2
+ "1月": "1月",
3
+ "2月": "2月",
4
+ "3月": "3月",
5
+ "4月": "4月",
6
+ "5月": "5月",
7
+ "6月": "6月",
8
+ "7月": "7月",
9
+ "8月": "8月",
10
+ "9月": "9月",
11
+ "10月": "10月",
12
+ "11月": "11月",
13
+ "12月": "12月",
14
+ "week__日": "日",
15
+ "week__一": "一",
16
+ "week__二": "二",
17
+ "week__三": "三",
18
+ "week__四": "四",
19
+ "week__五": "五",
20
+ "week__六": "六",
21
+ "提示": "提示",
22
+ "取消": "取消",
23
+ "确定": "確定",
24
+ "操作": "操作",
25
+ "保存": "保存",
26
+ "确认": "確認",
27
+ "没有更多数据了": "沒有更多數據了",
28
+ "上一页": "上一頁",
29
+ "下一页": "下一頁",
30
+ "显示": "顯示",
31
+ "共": "共",
32
+ "条": "條",
33
+ "收拢详细信息": "收攏詳細信息",
34
+ "展开详细信息": "展開詳細信息",
35
+ "已选中所有": "已選中所有",
36
+ "全选": "全選",
37
+ "待选择": "待選擇",
38
+ "搜索": "搜索",
39
+ "已选择": "已選擇",
40
+ "请填写": "請填寫",
41
+ "请填写邮件地址": "請填寫郵件地址",
42
+ "请填写网址": "請填寫網址",
43
+ "请填写数字": "請填寫數字",
44
+ "请填写正数": "請填寫正數",
45
+ "请填写字母或数字": "請填寫字母或數字",
46
+ "详情": "詳情",
47
+ "删除": "刪除",
48
+ "编辑": "編輯",
49
+ "自定义颜色": "自定義顏色",
50
+ "红色": "紅色",
51
+ "橙色": "橙色",
52
+ "黄色": "黃色",
53
+ "绿色": "綠色",
54
+ "蓝色": "藍色",
55
+ "紫色": "紫色",
56
+ "灰色": "灰色"
57
+ }
package/src/lng/zh.json CHANGED
@@ -1 +1 @@
1
- {}
1
+ {}
package/src/stories.js CHANGED
@@ -1,26 +1,26 @@
1
- import React from 'react'
2
- import { storiesOf } from '@storybook/react'
3
- import { setLocale } from './index'
4
- import { observable } from 'mobx'
5
-
6
- const l = localStorage.getItem('_gm-pc_' + 'lng')
7
-
8
- const store = observable({
9
- lng: (l ? JSON.parse(l) : '') || 'zh'
10
- })
11
-
12
-
13
- storiesOf('locales/locales', module).add('default', () => (
14
- <select
15
- value={store.lng}
16
- onChange={e => {
17
- localStorage.setItem('_gm-pc_' + 'lng', JSON.stringify(e.target.value))
18
- setLocale(e.target.value)
19
- store.lng = e.target.value
20
- }}
21
- style={{ verticalAlign: 'middle' }}
22
- >
23
- <option value='en'>English</option>
24
- <option value='zh'>中文</option>
25
- </select>
26
- ))
1
+ import React from 'react'
2
+ import { storiesOf } from '@storybook/react'
3
+ import { setLocale } from './index'
4
+ import { observable } from 'mobx'
5
+
6
+ const l = localStorage.getItem('_gm-pc_' + 'lng')
7
+
8
+ const store = observable({
9
+ lng: (l ? JSON.parse(l) : '') || 'zh'
10
+ })
11
+
12
+
13
+ storiesOf('locales/locales', module).add('default', () => (
14
+ <select
15
+ value={store.lng}
16
+ onChange={e => {
17
+ localStorage.setItem('_gm-pc_' + 'lng', JSON.stringify(e.target.value))
18
+ setLocale(e.target.value)
19
+ store.lng = e.target.value
20
+ }}
21
+ style={{ verticalAlign: 'middle' }}
22
+ >
23
+ <option value='en'>English</option>
24
+ <option value='zh'>中文</option>
25
+ </select>
26
+ ))