You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a bit of an odd scenario where I'm displaying a list of mixed values; some system default string values that need to be translated, and some user defined strings that shouldn't be translated.
I've gone through the docs a handful of times to see if there's a "pretty" way to check if a translation string ID exists and I ended up just implementing:
if(formatMessage({id: `some.key.${value}`})!==`some.key.${value}`){// do stuff}else{// do other stuff}
I don't like this method as it ends up giving me a TON of console errors. I'm wondering if there's a better way to do this. Any direction is appreciated!
Thanks!
The text was updated successfully, but these errors were encountered:
@tswardenski yeah this has come up before. My recommendation is to create a component to handle this. I'm not sure on your exact API of how to you want to receive value, but here's a place to start: #488 (comment)
I have a bit of an odd scenario where I'm displaying a list of mixed values; some system default string values that need to be translated, and some user defined strings that shouldn't be translated.
I've gone through the docs a handful of times to see if there's a "pretty" way to check if a translation string ID exists and I ended up just implementing:
I don't like this method as it ends up giving me a TON of console errors. I'm wondering if there's a better way to do this. Any direction is appreciated!
Thanks!
The text was updated successfully, but these errors were encountered: