Error when changing default language

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
|UI version|‘8.3.2’|
|Core version|‘8.3.0’|
|Build|‘My8xNi8yMDIyfDJiMGM2Y2IyZA==’|
|WebViewer Server|false|
|Full API|false|

Detailed description of issue
Javascript error when trying to setup the FR language : “Uncaught (in promise) TypeError: Cannot set properties of undefined (setting ‘i18n’)”
Screenshot : 2022-03-25_10-52-25

Expected behaviour
just use the right language

Does your issue happen with every document, or just one?
all documents concerned

Code snippet
WebViewer({path: ‘assets/plugins/pdf_js_viewer/lib’,
licenseKey: ‘XXXXX’,
initialDoc: fichier,
}, document.getElementById(‘pdf_viewer’))
.then(instance => {
const { Core, UI } = instance;
instance.UI.setLanguage(‘fr’);

	Core.documentViewer.addEventListener('documentLoaded', () => {
		instance.Core.documentViewer.zoomTo(2, 0, 300);
	})
});

thanks for your help

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi There,

Thanks for your question.

I used your code here and it worked when I changed the quotation marks in the French language, as follows.

WebViewer({
   path: ‘assets/plugins/pdf_js_viewer/lib’,
   licenseKey: ‘XXXXX’,
   initialDoc: fichier,
}, document.getElementById(‘pdf_viewer’))
.then(instance => {

   const { Core, UI } = instance;
  
   UI.setLanguage('fr');
   
   Core.documentViewer.addEventListener('documentLoaded', () => {
      instance.Core.documentViewer.zoomTo(2, 0, 300);
   });

});

Please let me know if this works for you as well.

Thank you,

Dandara

It works ! thanks
Not sure to understand with this syntax, but it helps !