ZestfulNation / vue-hotel-datepicker

A VueJS v2 responsive date range picker. Displays the number of nights selected and allow several useful options like custom check-in/check-out rules, localization support and more.
https://zestfulnation.github.io/vue-hotel-datepicker/
MIT License
840 stars 220 forks source link

Translation error after update #322

Closed ShapesGraphicStudio closed 1 year ago

ShapesGraphicStudio commented 1 year ago

I just updated to latest version to see if it could fix some errors. But I have a new one appearing.

When using translations, at arrival date selection I get: [Vue warn]: Error in v-on handler: "TypeError: newT is undefined"

Any idea why?

Here's how I did it:

<HotelDatePicker
    ...
    :i18n="frFR"
    ...
 />
data: () => ({
    ...
    frFR: {
        night: 'Nuit',
        nights: 'Nuits',
        'day-names': ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
        'check-in': 'Date d\'arrivée',
        'check-out': 'Date de départ',
        'month-names': ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
        'tooltip': {
            'halfDayCheckIn': 'Arrivée seulement',
            'halfDayCheckOut': 'Départ seulement',
        },
    },
    ...
}),
ShapesGraphicStudio commented 1 year ago

Seems like I was missing some lines in tooltips section:

'saturdayToSaturday': 'Only Saturday to Saturday',
'sundayToSunday': 'Only Sunday to Sunday',
'minimumRequiredPeriod': '%{minNightInPeriod} %{night} minimum.',

Looks like it's working now with those additions.