You can check out ui-i18n https://github.com/angular-ui/ui-utils/pull/173,
the performance is better than angular-translate and is lighter weight with
a simpler syntax imo.
Cheers,
Tim Sweet
On Monday, 3 September 2012 03:26:07 UTC-7, Daniele Paviani wrote:
>
> Hi, i've started developing with AngularJS two days ago and I want to be
> sure to do the things in the "right" way. I think this discussion can be
> useful not only for me, but for all angular newbies.
>
> This is my first problem: I want to show the page in two language, let's
> say English and Italian
>
> This is my solution, can you tell me if I'm doing it the right way or not?
> (I mean, "ok, it works, but is it the Angular way of implementing this kind
> of solution?")
>
>
> HTML in a template
>
> <span myapp-label data-label="helloWorld"></span>
>
>
> DIRECTIVE
>
> .directive('myappLabel',['labels',function(labels,$locale){
>
>
>
> return function(scope, elm, attrs){elm.text(labels[$locale.id][attrs[
> 'label']])};
>
>
>
> }])
>
> SERVICE
>
> .value('labels',{
>
> en-us:{helloWorld: 'Hello World' },
>
> it-it: {helloWorld: 'Ciao Mondo'}
>
> })
>
>
>
> any suggestion? thanks
>
--
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/groups/opt_out.