You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/10/30 18:54:35 UTC
[GitHub] williaster commented on a change in pull request #6222: Integrate
translation module @superset-ui/translation
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org