Vue-material: DatePicker locale

Created on 14 Dec 2017  路  7Comments  路  Source: vuematerial/vue-material

DatePicker can't set locale language.

question

Most helpful comment

Great!, but what about the cancel and ok buttons?

All 7 comments

You can access locales with this.$material.locale

Here is object what you need to pass there: https://github.com/vuematerial/vue-material/blob/dev/src/material.js#L9

thanks so much !

Great!, but what about the cancel and ok buttons?

I am trying to add localisation support to my project but I cannot find any way to override/hack the default Cancel button.
I prefer to avoid switching to another datepicker (as the rest of my project uses vue-material) so if someone has a solution I would be very thankful..

@BorisBrogle Hi,
I found a small solution for that, I think that it could be more clean, but for now it do the job:

so, in my javascript file, I wrote that:
Vue.material.locale.cancelButton = "Annuler"; (for a french translation for example)

the second step is to search/replace in the vue-material.min.js file the following content
search e._v("Cancel") and replace by e._v(e.locale.cancelButton)

for me now I can change the label easily

Hi @ianacid, thanks for your answer.

Yeah I guess the only solution at the moment is to change directly in the package files like you did. I will do it that way then.

Hopefully it will change pretty soon as I saw there are new maintainers on the project!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diverted247 picture diverted247  路  3Comments

maryleloisa picture maryleloisa  路  3Comments

lovepluskaka picture lovepluskaka  路  3Comments

tridcatij picture tridcatij  路  3Comments

bryanspearman picture bryanspearman  路  3Comments