React's linter (ESLint) warns about unescaped apostrophes (') in JSX content with the error:
This occurs when translation strings contain apostrophes, which is common in many languages.
We've implemented an automatic apostrophe escaping mechanism in our i18n setup that works in two ways:
The i18n.js file has been modified to automatically escape all apostrophes in translation strings using a custom formatter in the interpolation configuration:
This ensures that all translations retrieved through the standard t() function will have apostrophes properly escaped.
For cases where you need more control, we've also created:
useSafeTranslation HookSafeTranslation ComponentescapeApostrophes utility function in lib/utils.ts handles the actual escapingi18n.js applies this escaping globallySafeTranslation component and useSafeTranslation hook provide alternative ways to use escaped translations'). If you have other characters causing similar issues, you may need to extend the escaping function.