frappe / gantt

Open Source Javascript Gantt
https://frappe.io/gantt
MIT License
4.77k stars 1.06k forks source link

German Language Customization #378

Open simongiesen opened 9 months ago

simongiesen commented 9 months ago

Hi folks,

I am trying to localize my project into German. No success. What I am trying:

var gantt = new Gantt("#gantt", tasks, {
            header_height: 50,
            column_width: 30,
            step: 24,
            view_modes: ['Quarter Day', 'Half Day', 'Day', 'Week', 'Month'],
            bar_height: 20,
            bar_corner_radius: 3,
            arrow_curve: 5,
            padding: 18,
            view_mode: 'Month',
            date_format: 'YYYY-MM-DD',
            language: 'de',  
            custom_popup_html: null,
        });

language:'de' is throwing the following error:

Uncaught TypeError: Cannot read properties of undefined (reading '0') at Object.format (frappe-gantt.js:177:36) at Gantt.get_date_info (frappe-gantt.js:1510:45) at frappe-gantt.js:1498:28 at Array.map () at Gantt.get_dates_to_draw (frappe-gantt.js:1497:34) at Gantt.make_dates (frappe-gantt.js:1467:31) at Gantt.render (frappe-gantt.js:1300:14) at Gantt.change_view_mode (frappe-gantt.js:1201:14) at new Gantt (frappe-gantt.js:1048:14)

Please help ... kind regards!

simongiesen commented 9 months ago

PS: My sample data is

var tasks = [
        {
            id: '112240117000',
            name: 'TA903A FE',
            start: '2024-02-01',
            end: '2024-02-10',
            progress: 20
        },
        {
            id: '050240111000',
            name: 'AA745 254µm unpoliert FE',
            start: '2024-02-05',
            end: '2024-02-15',
            progress: 40
        }
        ];
tommasoiovane commented 8 months ago

The same happens with italian, but it seems to work with es and fr