Skip to content
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

docs: Adds ADR 10. Localization #107

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions docs/decisions/0010_localization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
10. Localization of user-facing content
#######################################

Status
******

Accepted

Context
*******

.. note:: Terminology

* A "locale" is a specific language and region.

E.g., Spanish is spoken in several locales: ``es-ar`` (Argentina), ``es-mx`` (Mexico), ``es-es`` (Spain), etc.

* Internationalization (i18n) is the process of developing products that can be adapted to different languages and
cultures.

* Localization (l10n) is the process of adapting a product or content for a specific locale.


Open edX is used worldwide. So for Aspects to be a fully-supported part of the Open edX ecosystem, it must at least
support translations for user-facing content, page layout for left-to-right and right-to-left languages. It may also
support localized representations of dates and calendars.

Superset provides Aspect's user interface, and it supports a subset of locales for translating/displaying the menus and
pages that the application serves. However, Superset does not translate its application or asset data, i.e. the
dashboards and charts shown to users. Superset also has some open issues related to localization (e.g. `issue#25258`_).

Aspects must maintain and display translated versions of its supported Superset assets.

Decision
********

* Aspects build process will support extracting user-facing content from Superset assets for translation, the production
of translated dashboards and charts, and synchronization of the latest translations to the project.
* Normal Aspects users (non-superusers) will only see the dashboards and charts that match their preferred language as
selected in the LMS.
* Open edX superusers using Aspects will see all translations of all Superset assets, so that they are able
* All Superset users may choose their preferred locale for Superset menus and pages from the "Languages" menu after
logging in; this will not be chosen automatically from their Open edX preferred language.
* Aspects will contribute to Superset's i18n and l10n efforts where possible.

Consequences
************

#. Aspects will configure Superset to run with a set of locales that best matches those locales Open edX supports.
#. Aspects will create translated copies of all user-facing Superset assets (dashboards and charts).
#. Access to these translated dashboards will be gated by role-based access controls (RBAC) using locale-specific roles.
Users are added to the locale-specific role that best matches their preferred language in Open edX, and so are
granted access to the appropriate translated dashboards and charts.
#. Like other Open edX projects, translations for the Aspects project will be maintained in Transifex.
#. Translations will be automatically synchronized using the Transifex Github App as per `OEP-58`_.
pomegranited marked this conversation as resolved.
Show resolved Hide resolved

Rejected Alternatives
*********************

**Translate assets on the fly with javascript**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ian2012 Are there any other rejected alternatives that I should document here? I just made this one up..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give support for asset translations in Superset apache/superset#13442

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed with #110


Another way to implement translations in the browser is using javascript and a mapping between English words/phrases and
the translated words/phrases (e.g. `simple-translator`_). However, this approach cannot discern the context around how
words/phrases are used, and so providing accurate translations for complex content can be difficult or impossible. This
approach would also slow page load times and would provide a sub-standard user experience.

References
**********


.. _OEP-58: https://docs.openedx.org/projects/openedx-proposals/en/latest/architectural-decisions/oep-0058-arch-translations-management.html
.. _issue#25258: https://github.com/apache/superset/issues/25258
.. _simple-translator: https://github.com/andreasremdt/simple-translator