How to switch the i18n language translation programmatically

377 views
Skip to first unread message

jke.s...@googlemail.com

unread,
Sep 11, 2014, 5:03:42 AM9/11/14
to pdfnet-w...@googlegroups.com
Hi,

we've provide web content where the user can select the language of the interface. However, the WebViewer does not follow this change. So basically if the user decides to read an pdf/xod in es we would like to change to the i18n es translation of the control-tool-tips and other labeling.

How can I achieve this?


Thanks,
Jens

Matt Parizeau

unread,
Sep 11, 2014, 12:41:36 PM9/11/14
to pdfnet-w...@googlegroups.com
Hi Jens,

You could take a look at the internationalization sample included in the WebViewer download (samples/i18n/config.js is the file you'll want to look at or hosted here).

Basically you'll just need to call:
i18n.setLng('es', function() {
    $
('body').i18n();
});

Matt Parizeau
Software Developer
PDFTron Systems Inc.

jke.s...@googlemail.com

unread,
Sep 17, 2014, 9:09:03 AM9/17/14
to pdfnet-w...@googlegroups.com

Hey Matt,

 
thanks for your reply. I must have overlooked this. It works fine.
 
Kind regards,
Jens 

Kai Brümmer

unread,
Aug 27, 2015, 2:34:34 PM8/27/15
to PDFTron WebViewer
Dear Matt,

how can I add additional languages, as German. I created a translation-de.json file in i18n folder and tried to switch to language 'de'. But the viewer keeps showing English version. Do I need to register the language somewhere?

Thank you.

Kai Brümmer

unread,
Aug 27, 2015, 2:34:36 PM8/27/15
to PDFTron WebViewer
Dear Matt.

OK, for some reason it works now. German labels are working. Seems it was a caching issue... Sorry for that.
Are you interested in the german translation file?

Regards Kai



Am Donnerstag, 11. September 2014 18:41:36 UTC+2 schrieb Matt Parizeau:

Matt Bojey

unread,
Aug 27, 2015, 3:25:14 PM8/27/15
to PDFTron WebViewer
Hi,

That would be awesome, thanks!

Matt
Reply all
Reply to author
Forward
0 new messages