question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatic translation (i18n) support for emptyText

See original GitHub issue

Is your feature request related to a problem? Please describe.

The emptyText prop value of field components is not automatically translated as it is done for the label prop.

Describe the solution you’d like

Having the possibility to have the emptyText prop value being translated when available for example:

<Tab
  // The label prop is being automatically translated.
  label="resources.rides.tabs.path"
  path="path"
>
  <DateField
    source="startedAt"
    showTime
    // Expected to be translated too.
    emptyText="resources.rides.emptyText.notStarted"
  />
</Tab>

Describe alternatives you’ve considered

I am using useTranslate hooks with the result store in a variable like so: const t = useTranslate();

Then I translate the key manually:

  <DateField
    source="startedAt"
    showTime
    emptyText={t('resources.rides.emptyText.notStarted')}
  />

Additional context

N/A

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fzaninottocommented, Aug 30, 2022

Please do it for all fields.

0reactions
fzaninottocommented, Sep 8, 2022

Indeed, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extract messages with empty text · Issue #245 - GitHub
I wanted to extract a message which is an empty string in the default language, but has a valid translation in other languages....
Read more >
Prefill and fallback languages - Learn the ins and outs of these ...
Prefill is one of LingoHub's powerful translation tools. It is a feature which fills empty text segments with content of matching texts from ......
Read more >
Options | SimpleLocalize
By default, only not translated strings (empty text) are translated to speed up the auto-translation process. This option forces SimpleLocalize ...
Read more >
How can I reuse i18n translation keys in Angular?
The <a> node shows up with empty text, not the translation target. (Further, by default there is no translation target in the auto-generated ......
Read more >
Rails Internationalization (I18n) API - Ruby on Rails Guides
There are a few steps to get up and running with I18n support for a Rails ... the config/locales directory to the translations...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found