williaster commented on a change in pull request #6222: Integrate translation
module @superset-ui/translation
URL:
https://github.com/apache/incubator-superset/pull/6222#discussion_r229440304
##########
File path: superset/assets/src/preamble.js
##########
@@ -0,0 +1,26 @@
+import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
+import { configure } from '@superset-ui/translation';
+import setupClient from './setup/setupClient';
+import setupColors from './setup/setupColors';
+
+// Configure translation
+if (typeof window !== 'undefined') {
+ const root = document.getElementById('app');
+ const bootstrapData = root ? JSON.parse(root.getAttribute('data-bootstrap'))
: {};
+ if (bootstrapData.common && bootstrapData.common.language_pack) {
+ const languagePack = bootstrapData.common.language_pack;
+ delete bootstrapData.common.locale;
+ delete bootstrapData.common.language_pack;
Review comment:
do these `delete` statements actually do anything since this is JSON
copied/parsed from the HTML?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]