Closed ZenTal29 closed 2 years ago
You may look at https://github.com/IBM/gantt-chart/issues/21 for some info.
I've read it before, but it's not very clear. Can you help me explain a little more clearly. Or it would be nice if there are basic steps.
you have const intl = Gantt.utils.getIntl(); if (intl) { if (intl.locale) { momentIntl.locale(intl.locale); } }
so if you use Gantt.utils.setInt(intl) with intl that has a locale field set to 'ja' then it will be used by moment-with-locales.js
I tried this code in generateDecorations .
const gantt = ctx.gantt; gantt .utils.setIntl('ja');
and
const gantt = ctx.gantt; gantt .utils.setIntl('ja', { weekdays : ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], months : ['1 月', '2 月', '3 月', '4 月', '5 月', '6 月', '7 月', '8 月', '9 月', '10 月', '11 月', '12 月'] });
but nothing happens except my chart is disabled and not visible anymore. Did I do something wrong at some point and need to configure it somewhere else?
It seems that it should be gantt.utils.setIntl({ locale : 'ja'} );
no ?
I tried this code and it works. Thanks for your advice !
gantt.utils.setIntl({locale : 'ja', formatMessage: () => {id: 'ja'}})
You're welcome !
Can someone give me an example to change timeline language to japanese ?
I found this setTimeWindow function at ibm-gantt-chart/jquery/timeline.js that can do this but I haven't figured out how to configure it. Please help me !!