Reputation: 11
I am using antv s2 library in my application which handle french and english languages. Antv S2 only have Chineese and English languages natively. Is there a way to add a new one?
I don't see anything about it in the Internationalization doc. When trying to extended internationalization I can only add keys to english and chineese languages.
Upvotes: 1
Views: 71
Reputation: 102577
You can use extendLocale
function to extend the internationalized text.
import { PivotSheet, setLang, extendLocale, i18n, getLang } from "@antv/s2";
extendLocale({
jp: {
小计: "小計",
总计: "合計",
总和: "集合体",
项: "項",
已选择: "厳選された",
//...
},
});
setLang("jp");
console.log(i18n("已选择"), getLang()); // 厳選された jp
Upvotes: 0