Multi language supported Application

Hi All,

I want to implement language translation in app.

If user change language from give list. language should reflect through out the application content.

Is any one has implemented this functionality ? . How can i implement??

im using http://angular-translate.github.io/

I have a action sheet in my setting for switching the language.
and for each language i have a file that contains my translations (Json style)

in html it looks like this:

{{ 'Setting.share' | translate }}  

and via Javascript:

$filter('translate')('Ui.close')

dont forget you have to include $filter in a controller to use via javascript

for a implemented version you can look here:

1 Like

Thanks for @Auro,

1)I am facing issue with translating html data.
I have html data in controller (Including HTML tag) . How can render html data in multiple language.

2)I have list of item which i getting from service. Then How can render data from service in multiple language.

do you mean something like this:

var confirmPopup = $ionicPopup.confirm({
                title: $filter('translate')('Setting.upgrade'),
                template: '<span >{{ "Setting.upgradeText" | translate }}</span>',
                okText: $filter('translate')('Ui.update') + (IAP.price || ''),
                okType: 'button-clear button-positive',
                cancelText: $filter('translate')('Ui.close'),
                cancelType: 'button-clear button-assertive'
            });

this is a popup as you can see the template is the same as normal html.

  1. it depends on what data you get?
    normally the service should return the desired language.
    something like this: <call_to_service>/lang/en

if not then it gets harder to achieve this. Did you develop the service?

the only thing i get in mind is parsing the data and replace the text with the current lag text

I am not understanding please help me.

i uploaded code on GitHub…

There is a service file

Service data, i am displaying on

i want to display data in different language.

For different language, i created json file. you can see in side json folder.

Thanks

ah sorry i misunderstand :smiley:
Can you make a example how how you want it to be rendred?
because i dont see data that needs to be translated.
(if you mean name property of friends explain why you want to translate this)

Actually, i want to display data like list and list description. List description come from service as per list item.

So, list and list description should display as per the selected language.

This service only gets and sets translation accordingly. We have to do all stylings manually