Git Product home page Git Product logo

Comments (2)

dosubot avatar dosubot commented on June 9, 2024 4

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:

  1. Wrap each dynamic string or potential string value in the t function.
  2. 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


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.

mistercrunch avatar mistercrunch commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.