You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/09/04 20:41:22 UTC
[PR] docs(i18n): document versioned language pack script delivery [superset]
rusackas opened a new pull request, #43904:
URL: https://github.com/apache/superset/pull/43904
### SUMMARY
Follow-up docs for #41780 (merged), which changed how the frontend translation catalog gets to the browser: instead of inlining it into the HTML, `spa.html` now loads it via a versioned `/language_pack/<lang>/<version>/script.js` tag that's cacheable for a year (content-addressed by a hash of the pack). That's an operator-facing behavior change - new unauthenticated route, new caching semantics, and it changes how `COMMON_BOOTSTRAP_OVERRIDES_FUNC` interacts with translations - and it wasn't covered anywhere in the docs.
Added a "Serving translated language packs" section to `configuring-superset.mdx`, next to the existing D3/locale config section, covering the script tag, the cache-control behavior on version match/mismatch, why the endpoint is unauthenticated, and how a `COMMON_BOOTSTRAP_OVERRIDES_FUNC`-supplied pack still takes precedence.
### TESTING INSTRUCTIONS
Docs only. Read through `docs/admin_docs/configuration/configuring-superset.mdx`.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
๐ค Generated with [Claude Code](https://claude.com/claude-code)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43904:
URL: https://github.com/apache/superset/pull/43904#issuecomment-5550855115
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers an incremental AI Review.
- `/review full` - Manually triggers a full AI Review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43904:
URL: https://github.com/apache/superset/pull/43904#issuecomment-5549744475
<!-- Bito Reply -->
The description in the documentation is technically accurate regarding the behavior of `no-cache`. While `no-cache` does allow a browser or shared cache to store the response, it mandates that the cache must revalidate the response with the origin server before using it. In the context of the stale URL, this ensures that the browser does not rely on the potentially outdated version stored locally, effectively preventing the use of the stale content without checking for updates first.
**docs/admin_docs/configuration/configuring-superset.mdx**
```
- 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 that response isn't cached under
the now-stale URL.
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #43904:
URL: https://github.com/apache/superset/pull/43904#discussion_r3939708853
##########
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 that response isn't cached under
Review Comment:
Good catch, that phrasing was sloppy. Reworded to say it forces revalidation rather than implying the response isn't cached at all.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #43904:
URL: https://github.com/apache/superset/pull/43904#issuecomment-5546254653
### <span aria-hidden="true">โ
</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">๐จ</span> Latest commit | 146043e7072c5d15096fe4c971588feb3009c1af |
|<span aria-hidden="true">๐</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a9b2cf174a0210008941e32 |
|<span aria-hidden="true">๐</span> Deploy Preview | [https://deploy-preview-43904--superset-docs-preview.netlify.app](https://deploy-preview-43904--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">๐ฑ</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">๐ค</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#FczBDcIwDEDRXXzGwg4RTdmAMdzELYiSWEmLhBC7E25f__A-YLU8bYMLwAGmKjneeqcS29Eqeh4CYVZNDf8PZ5UN7xwyNq0vxVXyssuiaBIfXUhqa3lfUzfOMk4uzjx4IcdEFEbPenLw_QE) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-43904--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #43904:
URL: https://github.com/apache/superset/pull/43904#discussion_r3939721979
##########
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:
**Suggestion:** Workers cache the pack version for their entire lifetime, so translation changes without a restart do not produce a stale-version response or new cache URL. [cache]
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d4e26abedc914880a079044afe2ddbbe&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d4e26abedc914880a079044afe2ddbbe&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docs/admin_docs/configuration/configuring-superset.mdx
**Line:** 168:171
**Comment:**
*Cache: Workers cache the pack version for their entire lifetime, so translation changes without a restart do not produce a stale-version response or new cache URL.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43904&comment_hash=aca4a5b49efa0aefe8d5c3fa9045e948520c090b7bc699da78641d41735fe582&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43904&comment_hash=aca4a5b49efa0aefe8d5c3fa9045e948520c090b7bc699da78641d41735fe582&reaction=dislike'>๐</a>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43904:
URL: https://github.com/apache/superset/pull/43904#issuecomment-5546212524
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #43904:
URL: https://github.com/apache/superset/pull/43904
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(i18n): document versioned language pack script delivery [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #43904:
URL: https://github.com/apache/superset/pull/43904#discussion_r3939620468
##########
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 that response isn't cached under
Review Comment:
`no-cache` still permits a browser or shared cache to store this response; it requires revalidation before reuse. Could this say that the stale URL is revalidated rather than that the response is not cached?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org