How to internationalize the timeline component of primefaces?

0

I'm using the timeline component of primefaces.

Timeline Primefaces

While using the "locale" property, it is not rendering in Portuguese.

<p:timeline id="timeline" value="#{timelineView.timelineModel}" height="auto"
                            var="evento"
                            showNavigation="true"
                            minHeight="30"
                            editable="false" varGroup="group"
                            groupMinHeight="30"
                            selectable="true"
                            groupsChangeable="false"
                            widgetVar="timelineWdgt"
                            timeChangeable="true"
                            axisOnTop="true"
                            animate="false"
                            animateZoom="false"
                            showCurrentTime="true"
                            stackEvents="false"
                            start="#{timelineView.timeLineDataMenos1Hora}"
                            end="#{timelineView.timeLineDataMais7horas}"
                            min="#{timelineView.timeLineDataMinima}"
                            max="#{timelineView.timeLineDataMaxima}"
                            locale="pt_BR"
                            zoomMin="6000000"
                            zoomMax="31536000000"
                            groupsOnRight="false">
    
asked by anonymous 28.09.2016 / 14:47

1 answer

1

I was able to internationalize the component by creating a local.js file in the path:

  

... src \ main \ webapp \ resources \ js \ locales.js

PrimeFaces.locales['pt_BR'] = {
closeText: 'Fechar',
prevText: 'Anterior',
nextText: 'Próximo',
currentText: 'Começo',
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','Sábado'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
dayNamesMin: ['D','S','T','Q','Q','S','S'],
weekHeader: 'Semana',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: '',
timeOnlyTitle: 'Só Horas',
timeText: 'Tempo',
hourText: 'Hora',
minuteText: 'Minuto',
secondText: 'Segundo',
ampm: false,
month: 'Mês',
week: 'Semana',
day: 'Dia',
allDayText : 'Todo o Dia',

'MONTHS': ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
'MONTHS_SHORT': ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
'DAYS': ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"],
'DAYS_SHORT': ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
'ZOOM_IN': "Aumentar zoom",
'ZOOM_OUT': "Diminuir zoom",
'MOVE_LEFT': "Mover esquerda",
'MOVE_RIGHT': "Mover direita",
'NEW': "Novo",
'CREATE_NEW_EVENT': "Criar novo evento" };
    
29.09.2016 / 16:40