Lighthouse-io / react-visjs-timeline

React component for the vis.js timeline module
MIT License
210 stars 91 forks source link

local is ignored #56

Closed Dr-Satan closed 6 years ago

Dr-Satan commented 6 years ago

Hello, I would like to pass this component in french but it seems that the local custom is ignored

` const options = {

        locales: {
            // create a new locale (text strings should be replaced with localized strings)
            mylocale: {
                current: 'current',
                time: 'time',
                months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
                monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
                monthsParseExact: true,
                weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
                weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
                weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
            }
        },
        // use the new locale
        locale: 'mylocale',
        width: '100%',
        orientation: 'top',
        maxMinorChars: 3,
        zoomable: true,
        horizontalScroll: true,
        editable: true,
        start: this.state.startDate,
        end: this.state.endDate,
        stack: false,
        showMajorLabels: true,
        showCurrentTime: true,
        zoomMin: 1000000,
        type: 'range'
    }`
Dr-Satan commented 6 years ago

So I finally found after a lot of testing. Local was systematically ignored no matter what I did.

My solution to put in French (or in any other language)