Leaving Fullcalendar in the en-BR language

Hello, I downloaded a template fullcalendar from Adan Shaw, only the default language is English, I would like to leave it in Portuguese. How do I carry out this change? Thanks.

Author: Danilo Pádua, 2015-12-02

3 answers

Inside the folder you downloaded from fullcalendar, you have the lang subfolder that contains all languages supported by fullcalendar

paste 1

paste 2

Copy javascript pt-br.js and include it in your project.

Your header would look like this:

<script src='fullcalendar/fullcalendar.js'></script>
<script src='fullcalendar/lang/pt-br.js'></script>
<script>

    $(document).ready(function() {

        $('#calendar').fullCalendar({
            //toda chamada de texto do fullcalendar será buscada do arquivo pt-br.js
        });

    });

</script>

Here is the official documentation that can help you.

 15
Author: GustavoR., 2015-12-02 13:25:25

Try changing your fullcalendar settings like this:

calendar = $('#calendar').fullCalendar({
    ignoreTimezone: false,
    monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
    monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
    dayNames: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sabado'],
    dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
    titleFormat: {
        month: 'MMMM yyyy',
        week: "d[ MMMM][ yyyy]{ - d MMMM yyyy}",
        day: 'dddd, d MMMM yyyy'
    },
    columnFormat: {
        month: 'ddd',
        week: 'ddd d',
        day: ''
    },
    axisFormat: 'H:mm',
    timeFormat: {
        '': 'H:mm',
        agenda: 'H:mm{ - H:mm}'
    },
    buttonText: {
        prev: "&nbsp;&#9668;&nbsp;",
        next: "&nbsp;&#9658;&nbsp;",
        prevYear: "&nbsp;&lt;&lt;&nbsp;",
        nextYear: "&nbsp;&gt;&gt;&nbsp;",
        today: "Hoje",
        month: "Mês",
        week: "Semana",
        day: "Dia"
    }
});
 12
Author: Danilo Pádua, 2015-12-02 12:44:30

You can set the property locale to pt-br.

However, even changing the locale, I had to set other properties manually, such as timeFormat, buttonText, among others.

Check out my current settings:

this.calendarOptions = {
      locale: 'pt-br',
      timeFormat: 'HH:mm',
      editable: true,
      eventLimit: false,
      displayEventTime: this.displayEventTime,
      slotLabelFormat: 'HH:mm',
      allDayText: '24 horas',
      columnFormat: 'dddd',
      header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay,listMonth'
      },
      buttonText: {
        today: 'Hoje',
        month: 'Mês',
        week: 'Semana',
        day: 'Hoje',
        list: 'Lista'
      },
      events: this.eventsCalendar
    };

Documentation with more details about locale: https://fullcalendar.io/docs/locale

 1
Author: Pedro H., 2020-08-03 17:27:26