openedx / paragon

💎 An accessible, theme-ready design system built for learning applications and Open edX.

Home Page:https://paragon-openedx.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Unsupported locale" warnings from `@edx/frontend-platform` in MFEs due to locales returned by Paragon

adamstankiewicz opened this issue · comments

Bugs

Currently, Paragon supports following locales (source):

const messages = {
  ar: arMessages,
  ca: caMessages,
  'es-419': es419Messages,
  fr: frMessages,
  he: heMessages,
  id: idMessages,
  'ko-kr': kokrMessages,
  pl: plMessages,
  'pt-br': ptbrMessages,
  ru: ruMessages,
  th: thMessages,
  uk: ukMessages,
  'zh-cn': zhcnMessages,
  'es-ar': esarMessages,
  'es-es': esesMessages,
  'it-it': ititMessages,
  'pt-pt': ptptMessages,
  'tr-tr': trtrMessages,
};

However, when consuming the exported paragonMessages from @openedx/paragon in a React micro-frontend powered by @edx/frontend-platform, several i18n warnings are seen:

image

The locale messages passed from Paragon to @edx/frontend-platform in the Open edX micro-frontends ideally would only include locales that are officially supported (see list of [supportedLocales](https://github.com/openedx/frontend-platform/blob/5cf7cda8280d264785c46e75f1cbef98e0a1b9aa/src/i18n/lib.js#L38C7-L55).

Note: The several other "Unexpected locales" listed that are not related to Paragon as well, in use across many Open edX MFEs but not supported by @edx/frontend-platform. For example, @edx/frontend-component-footer seems to the culprit, exporting locales not officially supported by `@edx/frontend-platform.