rusackas commented on code in PR #42154:
URL: https://github.com/apache/superset/pull/42154#discussion_r3607436542
##########
superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx:
##########
@@ -121,14 +121,53 @@ use([
LabelLayout,
]);
+// Explicit per-locale imports rather than a template-literal dynamic
+// import: a computed import makes bundlers build a "context module" over
+// echarts/i18n, and resolving that directory through the echarts package's
+// `exports` map fails intermittently in webpack incremental builds
+// ("Package path ./i18n is exported ... but no valid target file was
+// found"). A static map is also the only thing that lets bundlers
+// code-split exactly the locales listed here. Keys are Superset locales
+// uppercased; echarts locales absent from this map fall back to English.
+const LOCALE_LOADERS: Record<string, () => Promise<{ default: object }>> = {
+ AR: () => import('echarts/i18n/langAR.js'),
+ CS: () => import('echarts/i18n/langCS.js'),
+ DE: () => import('echarts/i18n/langDE.js'),
+ EL: () => import('echarts/i18n/langEL.js'),
+ EN: () => import('echarts/i18n/langEN.js'),
+ ES: () => import('echarts/i18n/langES.js'),
+ FA: () => import('echarts/i18n/langFA.js'),
+ FI: () => import('echarts/i18n/langFI.js'),
+ FR: () => import('echarts/i18n/langFR.js'),
+ HU: () => import('echarts/i18n/langHU.js'),
+ IT: () => import('echarts/i18n/langIT.js'),
+ JA: () => import('echarts/i18n/langJA.js'),
+ KO: () => import('echarts/i18n/langKO.js'),
+ LV: () => import('echarts/i18n/langLV.js'),
+ NL: () => import('echarts/i18n/langNL.js'),
+ PL: () => import('echarts/i18n/langPL.js'),
+ RO: () => import('echarts/i18n/langRO.js'),
+ RU: () => import('echarts/i18n/langRU.js'),
+ SI: () => import('echarts/i18n/langSI.js'),
Review Comment:
Good catch, fixed! Same mismatch existed for `pt_BR`, so that's mapped now
too... turns out both were quietly falling back to English on `master` as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]