React-big-calendar: Change language to french

Created on 6 Jun 2017  ·  4Comments  ·  Source: jquense/react-big-calendar

Hello,
I have put, thanks to moment to locale "fr", but for change week or for change the display mode, is still in englsih, do you know how can i change this.

Exemple: i want "week" in french "mois".

Most helpful comment

Hello, you have to create translation object and then pass it as a prop to calendar.

My translation object

const messages = {
  allDay: 'Celý den',
  previous: '<',
  next: '>',
  today: 'Dnes',
  month: 'Měsíc',
  week: 'Týden',
  day: 'Den',
  agenda: 'Agenda',
  date: 'Datum',
  time: 'Čas',
  event: 'Událost',
  showMore: total => `+ Zobrazit další (${total})`
};

And then pass it like this:<ReactBigCalendar messages={messages} .../>

Hope it helps.

All 4 comments

Hello, you have to create translation object and then pass it as a prop to calendar.

My translation object

const messages = {
  allDay: 'Celý den',
  previous: '<',
  next: '>',
  today: 'Dnes',
  month: 'Měsíc',
  week: 'Týden',
  day: 'Den',
  agenda: 'Agenda',
  date: 'Datum',
  time: 'Čas',
  event: 'Událost',
  showMore: total => `+ Zobrazit další (${total})`
};

And then pass it like this:<ReactBigCalendar messages={messages} .../>

Hope it helps.

@mathieusanchez, as @martinnov92 said, you have to set messages prop. Here is my message configuration for french language:

const messages = {
  allDay: 'journée',
  previous: 'précédent',
  next: 'suivant',
  today: 'aujourd\'hui',
  month: 'mois',
  week: 'semaine',
  day: 'jour',
  agenda: 'Agenda',
  date: 'date',
  time: 'heure',
  event: 'événement', // Or anything you want
  showMore: total => `+ ${total} événement(s) supplémentaire(s)`
}

How would you add localization/translation for all the months in a custom toolbar?

Can I translate or customize month and day name?
Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dogC76 picture dogC76  ·  4Comments

tiaaaa123 picture tiaaaa123  ·  4Comments

ZacharyLangley picture ZacharyLangley  ·  3Comments

Beyazatli picture Beyazatli  ·  3Comments

bionicvapourboy picture bionicvapourboy  ·  3Comments