-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate localisation config #875
Comments
Hi @stephenwf what do you think the best structure for the lang files would be? Would a directory structure similar to this be a solution:
as opposed to a single locale file per language? Also, I see that some of the languages are not in sync - en-GB sometimes contains text that isn't available in other languages. as part of this work would a script to validate the language files be an idea? I looked at something similar a while ago - #689 - something that could be run such as |
I think that folder structure looks good. Keeps them all in one place. I think having a A validation script would certainly be very useful, good idea! |
Hi @stephenwf, Had a quick look at this. Added the extension config files to I've tried passing the extension that's being requested - https://github.com/404mike/universalviewer/blob/main/src/content-handlers/iiif/IIIFContentHandler.ts#L387 - through to - https://github.com/404mike/universalviewer/blob/main/src/content-handlers/iiif/modules/uv-shared-module/BaseExtension.ts#L477 Also added a script to check if the languages are out of sync with the English config files for each extension - https://github.com/404mike/universalviewer/blob/main/src/locales/validate.ts - which can be run with Happy to discuss this in the next UV dev call. |
Revisiting this ticket with a different approach. I've created a locales JSON file (English only for POC) Created a single config file for a module (uv-openseadragon only for POC) Passed the extension name through to the In The config is then sent to a new function |
All issues will be triaged for further investigation or closure by the 28 September 2023. If your issue is still relevant and would like for it be investigated further please comment by 14 September 2023. |
At the moment we have the locales (dynamically imported) from the BaseExtension:
https://github.com/UniversalViewer/universalviewer/blob/67ada49f6d866a51ab173d7166f6ddf04fffb471/src/content-handlers/iiif/extensions/uv-default-extension/Extension.ts
But then, some of the classes that extend from this base redefine the locales, without modification. This makes it difficult to add a new locale (e.g. #874)
Examples:
universalviewer/src/content-handlers/iiif/extensions/uv-pdf-extension/Extension.ts
Lines 34 to 40 in 67ada49
universalviewer/src/content-handlers/iiif/extensions/uv-ebook-extension/Extension.ts
Lines 39 to 45 in 67ada49
universalviewer/src/content-handlers/iiif/extensions/uv-av-extension/Extension.ts
Lines 34 to 40 in d3b9da5
A fix for now would be to remove these from the extensions that already extend from the base - unless there is a different base configuration.
The text was updated successfully, but these errors were encountered: