-
Notifications
You must be signed in to change notification settings - Fork 255
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
Multilingual manifest labels #3470
Comments
Thanks for creating the issue. @camillevilla and I took a look at the issue and suspect a bug or regression upstream in manifesto, but probably needs more investigation and a test case to file an issue upstream. @jbaiter , any chance you have any insight here? |
I just looked into it, it seems that this is due to a mix of Mirador using a deprecated API for getting the value of a property value, and Manifesto having a broken deprecation path for it (introduced by yours truly in this PR 😬 ). To be more specific, in the current API, I'll try to fix this on both ends, i.e. make Mirador pass the explicit locale to all |
Ah -- that sounds like a better API for us.. I think our current approach is to completely re-parse the manifest when the locale changes. |
Another advantage of the new API is that it accepts a list of locales (in descending order of preference), which maps nicely to the My current plan for the implementation is:
What do you think? |
That sounds reasonable. I'm struggling to remember what the original UX intention was regarding fallback languages and if there's anything there that might trip up your plans. |
This admittedly huge changeset refactors the way the correct language value for a given property value is determined. A recent change in the Manifesto library made it possible to pass a list of languages (in descending order of preference) to the `PropertyValue.getValue` and `PropertyValue.getValues` methods, instead of relying on a single default locale that would be set when parsing the manifest. This allows for a better user experience, since we can now dynamically respond to changes in the user's language preferences without having to re-parse the manifest. Additionally, we can make use of the browser's language preferences to better match the user's language abilities. However, this required a substantial reworking of quite a few parts of Mirador, namely: - Introduced a new `config.userLanguages` redux state variable that has the list of languages in descending order of preference (as returned by i18next.languages after setting the configured language) - Every selector that would previously simply call `getValue` on a property value was changed to retrieve the user languages from the store and pass them to `getValue`. Additionally, for property values that are displayed in the companion window, where the locale can be overridden separately from the global language, selectors are extended to take a third `overrideLanguages` parameter that allows customization of the languages passed to `getValue`/`getValues` - When changing the global language setting, the value in the companion window's `LocalePicker` (if enabled) now will select the next-best available language according to the langauge pereferences, if the desired language is not part of the metadata. As a whole, these changes now allow on-the-fly switching of languages via both the global language selector and the companion window locale picker for all property values parsed from the manifest, with support for falling back according to the user's client language preferences.
This admittedly huge changeset refactors the way the correct language value for a given property value is determined. A recent change in the Manifesto library made it possible to pass a list of languages (in descending order of preference) to the `PropertyValue.getValue` and `PropertyValue.getValues` methods, instead of relying on a single default locale that would be set when parsing the manifest. This allows for a better user experience, since we can now dynamically respond to changes in the user's language preferences without having to re-parse the manifest. Additionally, we can make use of the browser's language preferences to better match the user's language abilities. However, this required a substantial reworking of quite a few parts of Mirador, namely: - Introduced a new `config.userLanguages` redux state variable that has the list of languages in descending order of preference (as returned by i18next.languages after setting the configured language) - Every selector that would previously simply call `getValue` on a property value was changed to retrieve the user languages from the store and pass them to `getValue`. Additionally, for property values that are displayed in the companion window, where the locale can be overridden separately from the global language, selectors are extended to take a third `overrideLanguages` parameter that allows customization of the languages passed to `getValue`/`getValues` - When changing the global language setting, the value in the companion window's `LocalePicker` (if enabled) now will select the next-best available language according to the langauge pereferences, if the desired language is not part of the metadata. As a whole, these changes now allow on-the-fly switching of languages via both the global language selector and the companion window locale picker for all property values parsed from the manifest, with support for falling back according to the user's client language preferences.
This admittedly huge changeset refactors the way the correct language value for a given property value is determined. A recent change in the Manifesto library made it possible to pass a list of languages (in descending order of preference) to the `PropertyValue.getValue` and `PropertyValue.getValues` methods, instead of relying on a single default locale that would be set when parsing the manifest. This allows for a better user experience, since we can now dynamically respond to changes in the user's language preferences without having to re-parse the manifest. Additionally, we can make use of the browser's language preferences to better match the user's language abilities. However, this required a substantial reworking of quite a few parts of Mirador, namely: - Introduced a new `config.userLanguages` redux state variable that has the list of languages in descending order of preference (as returned by i18next.languages after setting the configured language) - Every selector that would previously simply call `getValue` on a property value was changed to retrieve the user languages from the store and pass them to `getValue`. Additionally, for property values that are displayed in the companion window, where the locale can be overridden separately from the global language, selectors are extended to take a third `overrideLanguages` parameter that allows customization of the languages passed to `getValue`/`getValues` - When changing the global language setting, the value in the companion window's `LocalePicker` (if enabled) now will select the next-best available language according to the langauge pereferences, if the desired language is not part of the metadata. As a whole, these changes now allow on-the-fly switching of languages via both the global language selector and the companion window locale picker for all property values parsed from the manifest, with support for falling back according to the user's client language preferences.
This admittedly huge changeset refactors the way the correct language value for a given property value is determined. A recent change in the Manifesto library made it possible to pass a list of languages (in descending order of preference) to the `PropertyValue.getValue` and `PropertyValue.getValues` methods, instead of relying on a single default locale that would be set when parsing the manifest. This allows for a better user experience, since we can now dynamically respond to changes in the user's language preferences without having to re-parse the manifest. Additionally, we can make use of the browser's language preferences to better match the user's language abilities. However, this required a substantial reworking of quite a few parts of Mirador, namely: - Introduced a new `config.userLanguages` redux state variable that has the list of languages in descending order of preference (as returned by i18next.languages after setting the configured language) - Every selector that would previously simply call `getValue` on a property value was changed to retrieve the user languages from the store and pass them to `getValue`. Additionally, for property values that are displayed in the companion window, where the locale can be overridden separately from the global language, selectors are extended to take a third `overrideLanguages` parameter that allows customization of the languages passed to `getValue`/`getValues` - When changing the global language setting, the value in the companion window's `LocalePicker` (if enabled) now will select the next-best available language according to the langauge pereferences, if the desired language is not part of the metadata. As a whole, these changes now allow on-the-fly switching of languages via both the global language selector and the companion window locale picker for all property values parsed from the manifest, with support for falling back according to the user's client language preferences.
This admittedly huge changeset refactors the way the correct language value for a given property value is determined. A recent change in the Manifesto library made it possible to pass a list of languages (in descending order of preference) to the `PropertyValue.getValue` and `PropertyValue.getValues` methods, instead of relying on a single default locale that would be set when parsing the manifest. This allows for a better user experience, since we can now dynamically respond to changes in the user's language preferences without having to re-parse the manifest. Additionally, we can make use of the browser's language preferences to better match the user's language abilities. However, this required a substantial reworking of quite a few parts of Mirador, namely: - Introduced a new `config.userLanguages` redux state variable that has the list of languages in descending order of preference (as returned by i18next.languages after setting the configured language) - Every selector that would previously simply call `getValue` on a property value was changed to retrieve the user languages from the store and pass them to `getValue`. Additionally, for property values that are displayed in the companion window, where the locale can be overridden separately from the global language, selectors are extended to take a third `overrideLanguages` parameter that allows customization of the languages passed to `getValue`/`getValues` - When changing the global language setting, the value in the companion window's `LocalePicker` (if enabled) now will select the next-best available language according to the langauge pereferences, if the desired language is not part of the metadata. As a whole, these changes now allow on-the-fly switching of languages via both the global language selector and the companion window locale picker for all property values parsed from the manifest, with support for falling back according to the user's client language preferences.
M3 seems to have an issue with multilingual manifest labels. This manifest should render the DE / EN label in the multilingual demo but regardless the locale picked, the first label is displayed.
The text was updated successfully, but these errors were encountered: