react-boilerplate / react-boilerplate-cra-template

:fire: Setup Create React App with React Boilerplate. Highly scalable & Best DX & Performance Focused & Best practices.
https://react-boilerplate.github.io/react-boilerplate-cra-template/
MIT License
1.87k stars 393 forks source link

[react-i18next] Interpolation & React nodes translations #147

Closed safranx closed 3 years ago

safranx commented 3 years ago

Description

Hello,

I would like to know if it's possible to use Trans Components from react-i18next because I did not succeed. (https://react.i18next.com/legacy-v9/trans-component)

I am asking to you this question because I noticed that you are not talking about it in your documentation (https://cansahin.gitbook.io/react-boilerplate-cra-template/building-blocks/i18n) and you are only using t() function.

If it's compatible with your helper yarn run extract-messages can you provide us an exemple ?

Thank you, best regards,

Versions

Can-Sahin commented 3 years ago

It's not compatible sorry. Only the translation hooks are supported. It's fairly simple actually if you look at the code. You should modify according to your needs.

safranx commented 3 years ago

Hello @Can-Sahin,

Trans component are quite useful even for a small project. Translation features without this behavior is a little bit weak (no links, no plurals, no text formatting etc.).

As you said here,it's pretty hard to implement something, so imagine for someone who didn't code the extracting process.

Do you have any tips to implement it (files, config to edit)?