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.

react-intl tries to translate grommet components

See original GitHub issue

In my grommet app, I am using react-intl for internationalisation. Things are working as expected and I can change the language on the fly.

But when I change to a non-english language, a ton of react-intl errors are thrown, looking like this: [React Intl] Missing message: "Tab Contents" for locale: "es", using default message as fallback. [React Intl] Missing message: "location-pin" for locale: "es", using default message as fallback. [React Intl] Missing message: "Skip to" for locale: "es", using default message as fallback.

I never use anything of those words (‘Tab Contents’, ‘location-pin’, ‘Skip’) as Ids for my react-intl messages.

I though there might be something going on in grommet behind the scenes related to internationalisation, that causes these Errors.

Would appreciate any input.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
alansouzaticommented, Jul 21, 2017

no 😦 we have Intl.getMessage all over our source code.

We will be removing this in grommet 2.0. I understand that forcing you to translate content is bad, but in this case it is for a good cause. It is important that folks with disabilities have content in spanish too 😃

1reaction
alansouzaticommented, Jul 21, 2017

Yeah. We are currently re-evaluating how we do messages for Grommet 2.0.

Currently Grommet 1.x uses react-intl also. We don’t have the resources to provide the translations for every language. I would recommend adding the spanish support for all the keys that are in this file:

https://github.com/grommet/grommet/blob/master/src/js/messages/en-US.js

They are used mainly for accessibility reasons. For example Skip To will be there if you press tab in your app. Blind users will rely on screen readers to read the content in the screen.

Hope it helps.

I’m closing this issue since I believe there is nothing to be changed in grommet but feel free to continue the discussion here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending react-intl with your own markup - Keypup
In this section we'll see how to use react-intl to translate messages and how to dynamically format these messages. Component & Hook. There...
Read more >
Documentation for Grommet - Medium
Each component has a doc.js file that contains documentation in the form of a custom library called react-desc created by Grommet.
Read more >
using react-intl to translate a message key outside a component
I'm using the react-intl library for internationalization. Inside a component, I use the injectIntl HOC to translate message keys:
Read more >
Documentation for Grommet - React - DevPress - CSDN
Grommet uses Styled Components (instead of object-based syntax like JSS), it handles theming properly (design tokens + minimal component tokens/styles), and it ...
Read more >
Intl NPM - npm.io
If your app needs to support more locales than English, you'll need to get Node to load the extra locale data, or use...
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