Localization | PDF.js language
See original GitHub issueHi!
Using PDF file viewer link and assets as per documentation
<a href="assets/js/pdf.js/web/viewer.html?file=../../../files/invoice.pdf">Arve</a>
and everything works.
- Wanted to change pdf.js viewer toolbar language.
<a href="assets/js/pdf.js/web/viewer.html#locale=et?file=../../../files/invoice.pdf">Arve</a>
Did not work. Wasn’t able to find any documentation regarding localization. Found other people having the same issue:
- https://github.com/mozilla/pdf.js/issues/3761 (Issue closed, but doesn’t seem to work). Example: http://mozilla.github.io/pdf.js/web/viewer.html#locale=he
- http://stackoverflow.com/questions/29407188/how-to-localize-pdf-js-toolbar
Please:
- Include localization in the documentation and provide a working example
- Consider assigning toolbar language using html lang attribute from html document.
<html lang="et">
for example. Or provide a solution to do it. It would be very easy to use on multilingual pages. Its not only English out there.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
PDF.js Express Viewer Localization & Language Support
Change languages. To change languages in PDF.js Express, simply call setLanguage on the instance while passing in the language code defined in the...
Read more >How to localize pdf.js toolbar? - javascript - Stack Overflow
I'm using Mozilla's pdf.js plugin. I want to know how to localize the toolbar into my native language. Which function will help?
Read more >Localization: Change Languages in JavaScript PDF Viewer
Localization : Updating Languages in Our JavaScript PDF Viewer · Chinese Simplified / Chinese Traditional (zh-Hans/zh-Hant) · Croatian (hr) · Czech (cs) ·...
Read more >742099 - Localize pdf.js strings and replace with the final ...
PDF Viewer is currently localized for a few locales by unofficial localizers (add-on developers that speak the language): ...
Read more >[pdfJS Viewer] How to change the language? - OutSystems
Hello Horacio,. I think ES localization files are not there. I'll add as soon as possible (probably only tomorrow). Cheers. 0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @yurydelendik. This fixed it. Wasn’t able to understand @Snuffleupagus example. Wasn’t sure I should change lines in core js file (e.g
PDFJS.locale = (PDFJS.locale === undefined ? navigator.language : PDFJS.locale
);How about using
<html lang="">
attribute (website language) to define interface language - if webpage uses another language - change the language in the interface. If html lang is not set use navigator navigator.userLanguage? I mean if we are going to have 5 different languages we need to overwrite the PDFJS.locale every time?What do you think?
PS! Please do update documentation regarding localization and provide a working example.
@yurydelendik @Snuffleupagus What is the suggested way to change locale now? I am only using viewer.html to render the pdf.