Litepicker
Litepicker copied to clipboard
Predefined ranges plugin do not support lang option
Describe the bug If a user wants the calendar to use different language than English this is done by using "lang" option. For example for German a user can have "lang": "de-AT". But this option is not supported in predefined ranges plugin. The default list of ranges is always in English and it comes from here https://github.com/wakirin/Litepicker/blob/master/src/plugins/ranges/index.js#L36-L41
To Reproduce Steps to reproduce the behavior: Example Litepicker object:
const picker = new Litepicker({
element: document.getElementById("litepicker"),
singleMode: false,
numberOfColumns: 2,
numberOfMonths: 2,
format: "DD.MM.YYYY",
autoApply: false,
buttonText: {"apply": "Übernehmen", "cancel": "Abbrechen"},
lang: "de-AT",
plugins: ['ranges'],
ranges: {
position: 'left'
}
});
Expected behavior When "lang" option is used for another language this should also be applied to the predefined ranges plugin. Ranges names should be translated into the matching language.
Related https://github.com/wakirin/Litepicker/issues/223
@wakirin could you review and merge request for custom labels?