-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
we will need to pull out ui text out of components into i18n files #22
Comments
Since we are probably interested in localizing messages that are shown via UI only, and all of the UI is implemented with Vue, I think it will be best to use a Vue localization plugin for that. The main benefit would be reactivity: UI will be updated automatically after a locale is changed. Browser extension localization API (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization) would be of not much help for us, I believe. First of all, it is tied to language preferences set in a browser configuration. Thus, there is no way to change a UI language without changing it in browser settings. I don't think changing it there is a viable in many cases:
There are several Vue.js i18n plugins to choose from (I omitted the ones that are not actively developed or requires special Vue modules such as Vuex):
What features would we need for i18n? In what way our i18n/l10n requirements may extend in the future? |
this is great info. let's discuss. |
Ok some basic requirements:
I think the trickiest part of this might be knowing where the separation between data models and ui elements lies and finding a solution that makes sense across all of these. For example, we have data coming back from the tufts-adapter that we map to Features which for which we use Constant strings to limit and normalize results. Those strings are currently in English, because our parsers output them in English. We probably would continue to normalize to English even if we have other parsers which use other languages, but then we may need to translate those strings for display, as well as extend them with abbreviations, extend them with captions, etc. (see my hack for gender abbreviations at https://github.com/alpheios-project/data-models/blob/master/src/i18n.js and https://github.com/alpheios-project/data-models/blob/master/src/feature.js#L80-L85 ) It would be nice to have a standard approach that worked across the entire ecosystem, but it might also be acceptable to have different approach for each distinct need (As long as those were used consistently). |
this is done for the ui text and messages. Will need to decide upon and implement a solution for the data and data providers still. |
we will need to pull out ui text out of components into i18n files
not an urgent priority but maybe something to do when we move components out of the extension into their own library
The text was updated successfully, but these errors were encountered: