# i18n Support
Waline's multi-language translations and fields all follow Valine's configuration, thank you very much!
# Basic Usage
Waline Multilingual support has been supported.
Default built-in:
zh
zh-CN
zh-TW
en
en-US
jp
jp-JP
Waline({
el: '#waline',
lang: 'en', // setting here
});
1
2
3
4
2
3
4
# Customize
Customization only takes two steps:
- Define
langName
andlocale
- Initialization Waline
Please write in strict accordance with the following
locale
format:
// 1.Define langName and locale
var locale = {
nick: 'NickName',
nickError: 'NickName cannot be less than 3 bytes.',
mail: 'E-Mail',
mailError: 'Please confirm your email address.',
link: 'Website',
placeholder: 'Comment here...',
sofa: 'No comment yet.',
submit: 'Submit',
reply: 'Reply',
cancelReply: 'Cancel reply',
comment: 'Comments',
more: 'Load More...',
preview: 'Preview',
emoji: 'Emoji',
expand: 'See more....',
seconds: 'seconds ago',
minutes: 'minutes ago',
hours: 'hours ago',
days: 'days ago',
now: 'just now',
uploading: 'Uploading',
login: 'Login',
logout: 'logout',
admin: 'Admin',
word: 'Words',
wordHint:
'Please input comments between $0 and $1 words!\n Current word number: $2',
};
// 2.Initialization Waline
Waline({
el: '#waline',
path: location.pathname,
serverURL: 'YOUR_SERVER_URL',
locale,
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
TIPS: The comment area is only for demo. If you have any questions, please go to Github Discussion to ask.
Preview: