Problem with show dynamic values depend on language

90 Views Asked by At

I working on some private project and like to have multilanguage UI.

I translated all languages of static text, which works nicely. But have issues when need to show translated text from backend API. I get for example place.about.en and place.about.es (where es or en is the name of language) and didn't know how to show each and if for example if ES didn't exists show EN value. Does anybody have some idea how to handle it?

1

There are 1 best solutions below

0
On BEST ANSWER

Maybe someone also has the same issue. You can use this package ngx-translate and this tutorial to make a multilanguage Ionic application. Then if you need something like I do, you simply add into the language file "PLACE_INFO": {"about": "{{about.en}}"} and into ionic page this one <p class="ion-text-wrap">{{'PLACE_INFO.about' | translate:placeInfo}}</p> and Ionic will bind your API response text into your view and show it in correct way.