JSON data with html tag
vivek-yes opened this issue · 2 comments
Is it possible to retrieve HTML tags from the language JSON? Example{ "exploreHeader": "< strong >Erkunden</ strong >" }.
Also Is it possible to change the language using link? Example < a href="#" >France< / a >
-
Is it possible to retrieve HTML tags from the language JSON? Example{ "exploreHeader": "< strong >Erkunden</ strong >" }.
You can usedictionary
directly instead ofText
component to achieve this. such as below:
const { dictionary } = useContext(LanguageContext); <strong>{dictionary.exploreHeader}</strong>
Please take a look atsrc/components/Explore.js
for more details. -
Also Is it possible to change the language using link? Example < a href="#" >France< / a >
You can achieve this by modifyingsrc/components/LanguageSelector.js
component. Currently, it uses aselect
HTML element but I think it should beul
HTML element in your case.
Thanks hcoz for the reply, this library is very beneficial to me and perfectly satisfies my needs.
I actually have both Select(dropdown) and click(button) options on my page. Click will only have one particular country, while Select will have a vast list of countries. Any suggestions for this issue?
It will be beneficial if you include the button language switcher to your library.
Thanks in advance!