If you are working on a multilingual app you should really look 
at http://angular-translate.github.io/

If you really want to do what you're asking, you could do:

    <span>{{lastNames['en_US']['daphne']}}</span>

and in your controller you could create a two-level hash object like this:

      $scope.lastNames = {
        'en_US': {
          'daphne': 'maddox'
        }
      };

That will work, but you'd basically be reinventing Angular Translate at 
that point, without all of the great usability that it provides.

Or, to be completely literal to your question, if you want this to be your 
html template:

    <span>{{name_en}}</span>
    <span>{{name_ar}}</span>

then in your controller you could say:

      $scope.name_en = 'abc';
      $scope.name_ar = '123';

but it seems unlikely that that is really what you're trying to do... 
anywhere there it is if so.


On Saturday, May 24, 2014 4:41:26 PM UTC-7, Mahmoud Abdel-Fattah wrote:
>
> I'm working on a bilingual app, and want to call the markup depends on 
> current language.
>
> So, I have a variable called "lang", now how can I call {{name+lang}}? it 
> should be either {{name_en}} or {{name_ar}
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to