Skip to content
On this page

Internationalization

Currently, the chart has two built-in languages, en-US and zh-CN. The default language is zh-CN. If you need to use another language, you need to complete the language registration for the core chart and the language registration for the pro chart.

Language register for core chart

typescript
import klinecharts from 'klinecharts'

// See https://klinecharts.com/en-US/guide/i18n.html
klinecharts.registerLocale(`${key}`, {
  ......
})
import klinecharts from 'klinecharts'

// See https://klinecharts.com/en-US/guide/i18n.html
klinecharts.registerLocale(`${key}`, {
  ......
})

Language register for pro

typescript
import { loadLocales } from '@klinecharts/pro'

// For specific keys, see https://github.com/klinecharts/pro/blob/main/src/i18n/zh-CN.json
loadLocales(`${key}`, {
  "indicator": "xxx",
  "main_indicator": "xxx",
  "sub_indicator": "xxx",
  ......
  ......
})
import { loadLocales } from '@klinecharts/pro'

// For specific keys, see https://github.com/klinecharts/pro/blob/main/src/i18n/zh-CN.json
loadLocales(`${key}`, {
  "indicator": "xxx",
  "main_indicator": "xxx",
  "sub_indicator": "xxx",
  ......
  ......
})

Released under the Apache License V2.