mistercrunch commented on code in PR #34119:
URL: https://github.com/apache/superset/pull/34119#discussion_r2208165975
##########
superset/views/core.py:
##########
@@ -891,6 +903,24 @@ def fetch_datasource_metadata(self) -> FlaskResponse:
datasource.raise_for_access()
return
json_success(json.dumps(sanitize_datasource_data(datasource.data)))
+ @event_logger.log_this
+ @has_access
+ @expose("/language_pack/<lang>/")
Review Comment:
yeah I thought through this wondering if this is a private or public
endpoint, and thought ideally should be public, but given the partitioning of
libraries in the frontend, and the fact that our i18n framework is monolithic
currently (no segmentation or context based on the provenance of the strings),
it felt like it would require significantly more work to do this properly.
Not sure whether the extension framework SIP mentions `i18n`, but it may be
a bit of a blindspot.
Without going to deep into it, it seems that if we want for extensions to be
localized/localizable, we'd need some way to segment the language pack based on
package provenance (backend/frontend, and break down per library on the
frontend side). The whole i18n stack might need to offer different ways to
fetch and apply translations.
Happy to help think through this, but it's a fairly significant amount of
work.
Note that one minor and valuable thing I considered while doing the work
here was to find a way to add metadata to translation to identify what is
frontend/backend, and make sure the endpoint only returns the strings intended
for the frontend ... The gettext-based/flask-babel framework we use does offer
ways to do such things, but I encountered some limitations, and decided to punt
on these.
This PR here addresses something pretty important - removing the language
pack from bootstrap data - but there's much more to do in this area.
--
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]