My app has to switch between two languages. I am currently using angular translate to handle i18n.
It is pretty straight forward for static content such as menu title, tabs name, etc.
I defined a translation table locally (translations_lang) and load them with
$translateProvider.translations('lang', translations_lang);
But I am not sure how to go about some of the dynamic data.
For my case, it’s products name and description which I query asynchronously from a remote database. The return data contains the products name and description in the two languages such as below
{
product_id : "123",
name_en : "shoes",
description_en : "a pair of shoes,"
name_es : "zapatos",
description_es : "un par de zapatos"
}
As this is a query result, the data changes based on filter criteria. So how can I incrementally add these new translations to the current “translation_en” and “translation_es” tables?