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 translations

See original GitHub issue

think about how we can handle something like:

    Нажмите <a onClick={this.handleClick}>здесь</a>.

maybe this can be an option

<translate>
    Нажмите <a onClick={this.handleClick}>здесь</a>.
</translate>

extracted result

msgid "Нажмите <to>здесь<tc>"
msgstr ""

Example 2

Осталось: <span>{this.props.complainTextSymbolsLeft}</span>
                    {ungettext([' символ', ' символа', ' символов'], this.props.complainTextSymbolsLeft)}.

to - tag open tc - tag close

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
MrOrzcommented, Mar 9, 2017

Whoa that was fast! I am currently on a trip with limited Internet connections, still catching up with rt. If React dependency is required inevitably, I agree with the idea that it should be in a separate npm package.

1reaction
AlexMostcommented, Mar 9, 2017

I have ended with something working here - https://jsfiddle.net/69z2wepo/72888/. Basically, we have rt tag, that can extract proper msgid and resolve translations from msgid with tags.

Good part

It works)

Bad part

To be able to place translated strings inside react component, I need to modify read only props.children somehow. I couldn’t find any appropriate solution for that and used React.cloneElement(). This adds react as a dependency to the whole lib. This one is a bad thing, and I am thinking about moving React support to some kind of extension of c-3po. What do you think guys @MrOrz @alxpy ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction - react-i18next documentation
react -i18next is a powerful internationalization framework for React / React ... The configuration options and translation functionalities like plurals, ...
Read more >
How to translate your React app with react-i18next
You learn how to you can translate your React app with react-i18next. The tutorial also explains how to manage the translations json files...
Read more >
react-translate
ReactTranslate does not give you a specific way to load translations, its goal is only to provide a way to pass translations down...
Read more >
React-i18next: Internationalization and translation with ...
I18next is an internationalization framework which has been written for JavaScript. It provides a complete method for localizing the product as ...
Read more >
Internationalization for react done right. Using the i18next ...
Needing a translation management? Want to edit your translations with an InContext Editor? Use the original provided to you by the maintainers of...
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