Skip to content

Commit a0ebd2d

Browse files
Eloisa Jocson-ItingMikhail Bashkirov
authored andcommitted
fix: support Chinese language
1 parent fe48484 commit a0ebd2d

File tree

13 files changed

+115
-0
lines changed

13 files changed

+115
-0
lines changed

packages/calendar/src/LionCalendar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ export class LionCalendar extends LocalizeMixin(LitElement) {
6767
case 'uk-UA':
6868
case 'uk':
6969
return import('../translations/uk.js');
70+
case 'zh-CN':
71+
case 'zh':
72+
return import('../translations/zh.js');
7073
default:
7174
return import(`../translations/${locale}.js`);
7275
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
nextMonth: '下一个月',
3+
previousMonth: '前一个月',
4+
};

packages/input-datepicker/src/LionCalendarOverlayFrame.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ export class LionCalendarOverlayFrame extends LocalizeMixin(DomHelpersMixin(LitE
106106
return import('@lion/overlays/translations/uk-UA.js');
107107
case 'uk':
108108
return import('@lion/overlays/translations/uk.js');
109+
case 'zh-CN':
110+
case 'zh':
111+
return import('@lion/overlays/translations/zh.js');
109112
default:
110113
return import(`@lion/overlays/translations/${locale}.js`);
111114
}

packages/input-datepicker/src/LionInputDatepicker.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ export class LionInputDatepicker extends LionInputDate {
129129
return import('../translations/uk-UA.js');
130130
case 'uk':
131131
return import('../translations/uk.js');
132+
case 'zh-CN':
133+
case 'zh':
134+
return import('../translations/zh.js');
132135
default:
133136
return import(`../translations/${locale}.js`);
134137
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
openDatepickerLabel: '打开日期选择器',
3+
};

packages/input-iban/src/LionInputIban.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export class LionInputIban extends FieldCustomMixin(LocalizeMixin(LionInput)) {
8282
return import('../translations/uk-UA.js');
8383
case 'uk':
8484
return import('../translations/uk.js');
85+
case 'zh-CN':
86+
case 'zh':
87+
return import('../translations/zh.js');
8588
default:
8689
return import(`../translations/${locale}.js`);
8790
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default {
2+
error: {
3+
isIBAN: '請輸入有效的{fieldName}。',
4+
isCountryIBAN:
5+
'請輸入有效的{validatorParams, select,\n' +
6+
'AT {奥}\n' +
7+
'BE {比利时的}\n' +
8+
'CZ {捷克}\n' +
9+
'DE {德语}\n' +
10+
'ES {西班牙语}\n' +
11+
'FR {法国}\n' +
12+
'HU {匈牙利}\n' +
13+
'IT {意大利}\n' +
14+
'NL {荷兰人}\n' +
15+
'PL {抛光}\n' +
16+
'RO {罗马尼亚}\n' +
17+
'另一个 {{validatorParams}}\n' +
18+
'} {fieldName}。',
19+
},
20+
};

packages/input/stories/localize.stories.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ storiesOf('Forms|Input Localize', module).add('localize', () => {
6868
>
6969
NL
7070
</button>
71+
<button
72+
@click=${() => {
73+
localize.locale = 'zh-CN';
74+
}}
75+
>
76+
CN
77+
</button>
7178
</p>
7279
`;
7380
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import zh from './zh.js';
2+
3+
export default {
4+
...zh,
5+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
label: '字段名',
3+
error: {
4+
notEqualsString: '这是一条错误消息。',
5+
},
6+
};

0 commit comments

Comments
 (0)