stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
474 stars 182 forks source link

UseBrowserLocale parameter has been removed in V19, but is still described in the documentation #2280

Closed Wisdomb33r closed 5 months ago

Wisdomb33r commented 5 months ago

Describe the bug The troubleshooting documentation (pdfviewer.net) still states in the Localization chapter :

Did you set the attribute useBrowserLocale? By default, it's false. Usually, it's better to set it to true. The pdf viewer uses the language the user has set in their browser settings and loads a translation file from the assets folder. If that doesn't work, please check the settings in the Angular.json file.

It might be good to update this description, which seems obsolete. Btw, was the parameter removed because the library now always load in the browser locale, at least if not instructed otherwise by the language parameter ?

Version info

stephanrauh commented 5 months ago

It's only four months ago and I've already forgotten why I removed it... but I remember I considered it an annoying attribute almost from start. In November 2022, I switch the default value to true. Since then, the attribute was essentially useless. If you add the translations to the index.html, they've got priority, anyways.

Talking of which: pdf.js has migrated to a different i18n library, so I'm not sure if that still works. However, I suspect nobody is using this approach. It shaves off two requests, but that's almost negligible given that the JavaScript libraries are so huge.

stephanrauh commented 5 months ago

Ah, my readme file says that inlined translations are gone for good. And memory returns. At some point in time, I began to feel there's no point in supporting a feature nobody's using, and when pdf.js started using the *.ftl files, the old inlined translations were broken, anyways, so I decided to remove the feature.

stephanrauh commented 5 months ago

I've found two mentions of the attribute and removed them. Thank you very much for pointing this out!