Litepicker icon indicating copy to clipboard operation
Litepicker copied to clipboard

Predefined ranges plugin do not support lang option

Open bnisevic opened this issue 3 years ago • 2 comments

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.

bnisevic avatar Apr 08 '21 20:04 bnisevic

Related https://github.com/wakirin/Litepicker/issues/223

kl3sk avatar Apr 21 '21 10:04 kl3sk

@wakirin could you review and merge request for custom labels?

gago8910 avatar Sep 13 '21 02:09 gago8910