Closed cylace closed 2 years ago
<date-picker :lang="lang"/>
data() {
return {
lang: {
monthFormat: 'MMMM',
},
}
}
https://github.com/mengxiong10/vue2-datepicker/blob/master/locale.md
@mengxiong10 thank you so much.
One question, for multi languages it doesn't work on my website. it's always on the same language.
i add this :
and add this on datepicker :
i tried this too:
You can change the global object.
<date-picker lang="en" />
import zh from 'vue2-datepicker/locale/zh-cn'
import en from 'vue2-datepicker/locale/en'
zh.monthFormat = 'MMMM'
en.monthFormat = 'MMMM'
I tried this but it's not correct it's strange. i've three languages
Can you show your code ?
It's my code, i've tried with method above but not correct. i search for moment :)
i tried with this method too :
i've that
i've good the full name but the translation is always on the same language for that.
i use :lang=lang and i've good a default lang but i add the method changeLang ()
<date-picker :lang="lang" />
import DatePicker from "vue2-datepicker";
import "vue2-datepicker/index.css";
import en from "vue2-datepicker/locale/en";
import fr from 'vue2-datepicker/locale/fr';
en.monthFormat = "MMMM";
fr.monthFormat = 'MMMM';
DatePicker.locale("en", en);
DatePicker.locale("fr", fr);
export default {
data() {
return { lang: 'en'}
},
methods: {
changeLang () {
this.lang = this.lang === 'en ' ? 'fr' : 'en'
}
}
}
Hi, i don't know why but i think that changeLang don't work. i try this and it's not working. [image: image.png] and it's my method for that. maybe add changeLang on <Date-picker :lang=lang ... /> .????
Op vr 1 jul. 2022 om 04:35 schreef 也无风雨 @.***>:
import DatePicker from "vue2-datepicker";import "vue2-datepicker/index.css";import en from "vue2-datepicker/locale/en";import fr from 'vue2-datepicker/locale/fr'; en.monthFormat = "MMMM";fr.monthFormat = 'MMMM';DatePicker.locale("en", en);DatePicker.locale("fr", fr); export default { data() { return { lang: 'en'} },methods: { changeLang () { this.lang = this.lang === 'en ' ? 'fr' : 'en' } }}
— Reply to this email directly, view it on GitHub https://github.com/mengxiong10/vue2-datepicker/issues/710#issuecomment-1171862686, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYHVJNP4QQB37UDM2IBH43VRZKQZANCNFSM52GC3CUA . You are receiving this because you authored the thread.Message ID: @.***>
Add a key for the component
<date-picker :lang="lang" :key="lang" />
i think that the problem is with an other module (as vui18n) because all is worked except that
Hi, unfortunately it's not working for me i don't know why. Maybe because other modules like vuei18n for translations ?
@cylace Maybe other global plugin change the methods.
ok thank you for your help. You're great ! And Very reactif. Thanks.
Hi, how can i change the 'mx-calendar-title-label' ?? I would change the title jun to juni for exemple (complète word not the three first letters). And wat is the method for translations for this ?? i've a website with 3 translations. For moment, i've that:![image](https://user-images.githubusercontent.com/57703077/176470113-12bf2c9e-a563-4ee6-94f5-84037b0d4108.png)
i would that:![image](https://user-images.githubusercontent.com/57703077/176470361-b3833697-f4f9-4d99-b1fc-3441af5feefd.png)
THank you so much for your help :)