How to switch the i18n language translation programmatically

已查看 377 次
跳至第一个未读帖子

jke.s...@googlemail.com

未读,
2014年9月11日 05:03:422014/9/11
收件人 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

未读,
2014年9月11日 12:41:362014/9/11
收件人 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

未读,
2014年9月17日 09:09:032014/9/17
收件人 pdfnet-w...@googlegroups.com

Hey Matt,

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

Kai Brümmer

未读,
2015年8月27日 14:34:342015/8/27
收件人 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

未读,
2015年8月27日 14:34:362015/8/27
收件人 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

未读,
2015年8月27日 15:25:142015/8/27
收件人 PDFTron WebViewer
Hi,

That would be awesome, thanks!

Matt
回复全部
回复作者
转发
0 个新帖子