I have a question about parsing values from a different source into a key. Here is the environment:
Translation.js
export default {
en: {
translation: {
Text: 'Text',
Welcome:"Welcome text",
}
},
tr: {
translation: {
Text: 'Selam',
Welcome:"Hoşgeldiniz",
}
},
}
Now, I want to pars let say Welcome text into this which is a component of Ant.Design here:
https://ant.design/components/notification/
And in a different file like example.js, I have this and can react the translation.js
const openNotificationForNonActivated = type => {
notification[type]({
style:{marginTop: "42px"},
message: 'Text',
description: 'Welcome Text',
duration: 5,
});
};
I normally can get the translation value with this code:
{t("Welcome")}
I believe this is because I am trying to react it in a const value. So, how can I handle this? Any idea,
Best, thanks; Osman