Comments (9)
Just to clarify, this is how I am using the trans component:
<Trans i18nKey="key">
Special{' '}
<span className="font-weight-light">
(e.g. bank holidays, events ...)
</span>
</Trans>
where the translation would be:
{
...,
key: 'Special <2>(e.g. bank holidays, events ...)</2>',
...
}
from i18next-emoji-postprocessor.
Can you try to add the postProcess: 'emoji'
option?
I suspect postProcess is not the working without that option for Trans component...
Need to ask @jamuhl if he knows more... I also suspect the tOption for Trans component is completely ignored...
This is probably because the overloadTranslationOptionHandler option is only executed, if no t options are passed...
This change in Translator.js fixes it, but breaks an older compatibility test:
from i18next-emoji-postprocessor.
https://github.com/i18next/react-i18next/blob/master/src/Trans.js#L259 you can pass in options via prop tOptions
from i18next-emoji-postprocessor.
Yes, setting tOptions individually works:
from i18next-emoji-postprocessor.
Thanks guys, I can confirm that adding:
postProcess: 'emoji'
to i18next options fixes this issue. Apparently there is no need to add this for every Trans component when that option is provided.
from i18next-emoji-postprocessor.
@PeterKottas Yes, that works, but itβs not an official api option... Iβve added a PR to react-i18next for further investigation next week...
from i18next-emoji-postprocessor.
@adrai it is official API -> it defines which postprocessors to run in each case: https://www.i18next.com/overview/configuration-options#translation-defaults
from i18next-emoji-postprocessor.
All ok, updated the readme
from i18next-emoji-postprocessor.
Lovely, thanks for your help gents!
from i18next-emoji-postprocessor.
Related Issues (2)
- Possible reference error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18next-emoji-postprocessor.