'React Apply a specific function to all strings of all components
in order to translate all strings in my app i need to put all them to an imported function.
what is smart way to do it for all instead of doing it one by one.
this is the code that i wanna repeat :
import { useTranslation } from "react-i18next";
const { t } = useTranslation();
for example: in a button text: added t()
{t("LOGOUT")}
t added to LOGOUT string
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|