Skip to content
Discussion options

You must be logged in to vote

This is a real gap, and gettext's standard answer (msgctxt, a translation context) is half-supported in Superset right now:

  • Backend: fine. Python code can use flask_babel's pgettext("context", "Open") (it's already among the recognized gettext functions in the i18n tooling).
  • Frontend catalog: also fine. superset-frontend/scripts/po2json.js explicitly keeps msgctxt entries, storing them under Jed's context + "\u0004" + msgid key, so a .po entry with msgctxt "Candlestick" survives the build.
  • Frontend lookup: missing. Translator.ts (superset-core/src/translation) only exposes translate() and translateWithNumber(), both calling this.i18n.translate(key) without a context. So frontend code lik…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by aikawa-ohno
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants