Primefaces extensions DocumentViewer in hyphenated languages not working
Asked Answered
S

1

6

I use pe:documentViewer for display documents and set 'locale' like pt (pt_pt, pt_br, pt-pt or pt-br) but nothing happens and the actions continues in english. why?

My code is:

<pe:documentViewer locale="pt" height="#{previewHeight}" value="#{previewComponent.file}"/>
Stinkwood answered 27/3, 2015 at 14:33 Comment(2)
how about pt-PT or pt-BR?Forwardness
basically when "locale" is hyphenated languages (like "pt-PT") the extension for documentViewer not working and the viewer keeps in English. why?Stinkwood
A
1

Solve by changing the locale javascript as it is a bug Primefaces Extension will not find the pt-BR,pt-PT:

&lt;pe:documentViewer value="#{document}" locale="pt" height="800"/&gt;

&lt;script type="text/javascript"&gt;

var src = document.getElementsByTagName("iframe")[0].src.replace('#locale=pt','#locale=pt-BR');

document.getElementsByTagName("iframe")[0].setAttribute('src', src);

&lt;/script&gt;
Airtoair answered 22/1, 2016 at 18:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.