79676447

Date: 2025-06-23 15:54:58
Score: 1.5
Natty:
Report link

v5.3.31 update, June 2025;

When trying to upgrade to the latest version (v5.3.31 as of 23/06/2025), I came across similar issues as with previous versions (above).

It looks like there's some lookups for locale in the code, but none worked for me if I used "#locale=" or "&locale=".

So I've added a similar workaround as above, but updated for the latest version;

In PDFjs/web/viewer.mjs;

Find localProperties, line 615;

  localeProperties: {
    value: {
      lang: navigator.language || "en-US"
    },
    kind: OptionKind.BROWSER
  },

Add an extra lookup above to check the URL for any locale's passed through, so change line 615+ to match;

  localeProperties: {
    value: {
      lang: new URLSearchParams(window.location.search).get("locale") || navigator.language || "en-US"
    },
    kind: OptionKind.BROWSER
  },

If there's a better way, someone do please let me know, but this small workaround resolved the issue for me.

Reasons:
  • Whitelisted phrase (-1): worked for me
  • RegEx Blacklisted phrase (2.5): please let me know
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Matt Scott