🌏 Internationalization
Currently, the chart has two built-in en-US
and zh-CN
. The default language is en-US
. If you need to use other languages, you can refer to the following scheme.
Adding new language
Adding new language is accomplished through klinecharts.registerLocale(key, locales)
.
For example, to add traditional Chinese language, you can do this,
typescript
klinecharts.registerLocale('zh-HK', {
time: '時間:',
open: '開:',
high: '高:',
low: '低:',
close: '收:',
volume: '成交量:',
turnover: '成交額:',
change: '漲幅:'
})
Use new language
After adding new language, you can complete language switching through the chart API init(options)
or setLocale(key)
.