dosubot[bot] commented on issue #35999:
URL: https://github.com/apache/superset/issues/35999#issuecomment-3490924122
<!-- Answer -->
Here’s a sample Dockerfile snippet that shows how to build Superset with a
custom frontend translation (like Serbian/Montenegrin):
```dockerfile
FROM apache/superset:3.1.0
# Copy your custom translation files (.po, .mo, and/or sr.json) into the
image
COPY superset/translations/sr /app/superset/translations/sr
# Set build argument to enable translation build
ARG BUILD_TRANSLATIONS=true
ENV BUILD_TRANSLATIONS=${BUILD_TRANSLATIONS}
# Rebuild frontend assets and translations
WORKDIR /app/superset-frontend
RUN npm ci
RUN npm run build-translation
# Clean up .po and .mo files (optional, as in upstream Dockerfile)
RUN rm -rf /app/superset/translations/*/*/*.po \
&& rm -rf /app/superset/translations/*/*/*.mo
```
**How it works:**
- Place your custom translation files in `superset/translations/sr` before
building.
- The `BUILD_TRANSLATIONS=true` argument triggers the translation build step
([reference](https://github.com/apache/superset/blob/master/Dockerfile)).
- `npm run build-translation` generates the frontend translation JSON files.
- The cleanup step removes unnecessary source files after the build.
If you need to register the new language in the frontend, make sure the
language code (e.g., `sr`) matches your translation file and is listed in the
supported languages config (like `supportedLanguages.js`). If you only want to
translate the Time Range filter, your translation file can be minimal.
Let me know if you need more details on registering the language or mapping
the locale!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/62fc1ba9-24b5-4aec-96d9-83572ec91310?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/62fc1ba9-24b5-4aec-96d9-83572ec91310?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/62fc1ba9-24b5-4aec-96d9-83572ec91310?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/62fc1ba9-24b5-4aec-96d9-83572ec91310?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/62fc1ba9-24b5-4aec-96d9-83572ec91310?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/62fc1ba9-24b5-4aec-96d9-83572ec91310?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/62fc1ba9-24b5-4aec-96d9-83572ec91310?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35999)
--
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]