Is there a way to check if a locale exists on react app ? Like a boolean true/false
Yes, you can check if your language variable exists with i18n.exists() method:
You can extract i18n from useTranslation hook.
const { t, i18n } = useTranslation();
Then call i18n.exists('my.key'), for example:
i18n.exists("common.values.active")
https://www.i18next.com/overview/api#exists
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With