Comments (2)
For handling missing translations for dynamic text in Superset, especially when the text is not being extracted using the standard approach, it's crucial to ensure that every dynamic string is explicitly wrapped with the t
function from @superset-ui/core
. This function is designed to mark strings for translation, making them recognizable to the extraction tools used in the project.
When dealing with dynamic content that changes based on application state or user input, follow these steps:
- Wrap each dynamic string or potential string value in the
t
function. - For conditions or variables that generate dynamic text, apply the
t
function to each possible outcome.
This method ensures that all dynamic texts are prepared for translation and can be included in the project's localization process. The t
function is part of Superset's internationalization strategy, allowing for the extraction and translation of strings into .po
files, which are then used for localization.
Remember, the effectiveness of the t
function and the translation process depends on the proper setup of the translation configuration in Superset. Ensure that the configure()
function has been called with the correct language pack and settings to activate the translation functionality.
If you encounter any limitations or issues with translating dynamic text using the t
function, such as untranslated strings or warnings, it might be related to the configuration setup or the extraction process. The project uses automated checks, including GitHub Actions workflows, to verify translations and ensure they are correctly updated and maintained.
This approach should address the issue with missing translations for dynamic text in your project. If you need further assistance or have more questions, feel free to ask.
Details
Sources
- superset-frontend/src/components/EmptyState/index.tsx
- superset/translations/es/LC_MESSAGES/messages.po
- superset/translations/pt_BR/LC_MESSAGES/messages.po
- superset/translations/it/LC_MESSAGES/messages.po
- superset-frontend/packages/superset-ui-core/test/translation/TranslatorSingleton.test.ts
- superset-frontend/packages/superset-ui-core/src/translation/TranslatorSingleton.ts
- superset/translations/de/LC_MESSAGES/messages.po
- superset-frontend/packages/superset-ui-core/test/translation/Translator.test.ts
- .github/workflows/superset-translations.yml
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
from superset.
Wait instrumentation looks right to me:
https://github.com/apache/superset/blob/master/superset-frontend/src/features/home/EmptyState.tsx#L41-L51
And the zh translations ->
https://github.com/apache/superset/blob/master/superset/translations/zh/LC_MESSAGES/messages.po#L18944-L18974
Not sure why it's not showing up.
from superset.
Related Issues (20)
- [Bug] Unable to edit mail list of existing alert & reports HOT 5
- Improper Input Validation while creating dashboard and charts HOT 1
- Can not specify recipient for slack or email for Superset Reports HOT 5
- Problem Exporting Charts as Diagram HOT 4
- Cannot fetch schema list and table list in sqllab after setting values to table_cache_timeout and schema_cache_timeout HOT 1
- Customize loading spinner position and appereance HOT 1
- New permalinks retain previous permalink activeTab state HOT 1
- No table names shown in Dataset creation window / SQL Lab for Apache Kyuubi HOT 1
- Add button grayed out even tough all fields are filled HOT 5
- Unable to execute any Superset command in terminal HOT 1
- Datasource access HOT 6
- Typo in IBM DB2 image reference in README.md HOT 2
- Gauge chart interval bounds and colors not working properly when added to a dashboard HOT 1
- Dataset access HOT 3
- Method 405 not allowed for guest_token fetching HOT 6
- There was an error loading the schemas HOT 4
- UUID columns show up as NULL HOT 1
- 0.12.11 fails for helm install HOT 2
- sql query is different from chart results HOT 4
- Inconsistent spacing between viz gallery charts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.