Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON data with html tag #9

Open
vivek-yes opened this issue Jun 26, 2023 · 2 comments
Open

JSON data with html tag #9

vivek-yes opened this issue Jun 26, 2023 · 2 comments

Comments

@vivek-yes
Copy link

vivek-yes commented Jun 26, 2023

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 >

@hcoz
Copy link
Owner

hcoz commented Jun 29, 2023

  • Is it possible to retrieve HTML tags from the language JSON? Example{ "exploreHeader": "< strong >Erkunden</ strong >" }.
    You can use dictionary directly instead of Text component to achieve this. such as below:
    const { dictionary } = useContext(LanguageContext); <strong>{dictionary.exploreHeader}</strong>
    Please take a look at src/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 modifying src/components/LanguageSelector.js component. Currently, it uses a select HTML element but I think it should be ul HTML element in your case.

@vivek-yes
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants