-
Notifications
You must be signed in to change notification settings - Fork 86
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
getTranslation to return string Type #11
Comments
In order to allow for the rendering of HTML inside translation strings it needs to be returned as an element. I will look into maybe only returning an element when HTML is detected in the translation, and for other scenarios it would just return a string. Would that satisfy your ask? |
Actually, if there is an option for me to choose String type would be good enough. |
I have updated the translate function to return a string when a translation does not include HTML. In the case where a translation contains HTML it will still return the translation wrapped in a I have also updated the README for getTranslate to explain this. I chose this route instead of adding an option because:
You can find the changes in v2.3.0. |
Cool. Thanks. Tested. :) |
Hi,
getTranslation is define to return LocalizedElement type
returns (key | key[], data) => LocalizedElement | { [key: string]: LocalizedElement }
Is there a way to return string type only?
Thanks
The text was updated successfully, but these errors were encountered: