gantt-for-react icon indicating copy to clipboard operation
gantt-for-react copied to clipboard

Any idea about translation or at least date localization?

Open phtmgt opened this issue 5 years ago • 1 comments

If none of this is possible, can we at the very minimum add translation for months?

I am thinking something of the sorts:

const {
      onClick,
      onDateChange,
      onProgressChange,
      onViewChange,
      customPopupHtml,
      tasks,
      viewMode,
      **language**
    } = this.props;

which could then be passed to frappe gantt:

this.ganttInst = new GanttJS(this.ganttRef, tasks, {
      on_click: onClick || noop,
      on_date_change: onDateChange || noop,
      on_progress_change: onProgressChange || noop,
      on_view_change: onViewChange || noop,
      custom_popup_html: customPopupHtml || null
      **language: language || null**
    });

However, I don't believe frappe gantt has a way of modifying month translations (adding extra languages), as date_utils is kind of static and does not accept props. Therefore, I am thinking we should at least try to implement date format options, so we can avoid month names by using numerical style, e.g. 01.2019 instead of January 2019.

Any thoughts?

phtmgt avatar Apr 30 '19 20:04 phtmgt

And, of course, just stumbled upon this, might be useful:

https://github.com/frappe/gantt/pull/117

phtmgt avatar Apr 30 '19 20:04 phtmgt