rusackas commented on code in PR #43904:
URL: https://github.com/apache/superset/pull/43904#discussion_r3939850035
##########
docs/admin_docs/configuration/configuring-superset.mdx:
##########
@@ -145,6 +145,41 @@ D3_TIME_FORMAT = {
Restart Superset after changing `superset_config.py` so the frontend receives
the updated formatter configuration.
+## Serving translated language packs
+
+Non-English page loads need the frontend translation catalog (the "language
+pack") available before the entry bundle runs, so translations are in place
+for the very first render instead of racing a later fetch. Superset delivers
+that pack as a separate, cacheable script rather than inlining it into the
+HTML:
+
+```html
+<script src="/language_pack/pt_BR/1a2b3c4d5e6f/script.js"></script>
+```
+
+`spa.html` emits this tag, pointing at the `language_pack_script` view, before
+loading the entry bundle whenever the request's locale isn't English. The
+`<version>` segment is a short hash of the pack's contents, so the URL is
+content-addressed:
+
+- When the version in the URL matches the server's current pack, the response
+ carries `Cache-Control: public, max-age=31536000, immutable` — the browser
+ fetches that language's pack once and reuses it across sessions.
+- If a cached HTML page references a version that's since changed (e.g. after
+ a translation update or upgrade), the endpoint still serves the current
+ pack, but with `Cache-Control: no-cache` so any copy stored under the
+ now-stale URL must be revalidated with the server before it's reused.
Review Comment:
Good catch, that was a real gap. Pushed a note that a translation update
needs a worker restart to take effect, since the pack and its version hash are
cached in-process for the worker's lifetime (see
`get_language_pack_version`/`get_language_pack` in
`superset/translations/utils.py`).
--
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]