I have this JSON from an API source:
"GREETINGS": [{
"TYPE_OF_GREETING": "{EVENING}",
"TEXT": "{G} {E} !!!!!"
},
{
"TYPE_OF_GREETING": "{NIGHT}",
"TEXT": "{G} {N} ... ."
}
]
From some other API (SPARQL) I can generate this "vocabulary" object:
const vocabulary = {
G: {
en: "Good",
de: "Guten",
it: "Buona"
},
E: {
en: "evening",
de: "Abend",
it: "serata"
},
N: {
en: "night",
de: "Nacht",
it: "notte"
}
};
Can you advice me the most efficient JavaScript code to get this result, please?
{
eveningGreeting: {
en: "Good evening !!!!!",
de: "Guten Abend !!!!!",
it: "Buona serata !!!!!"
},
nightGreeting: {
en: "Good night ... .",
de: "Guten Nacht ... .",
it: "Buona notte ... ."
}
}
Thank you very much for your help.