Localization Support

2,981 views
Skip to first unread message

Peter Andreas Molgaard

unread,
May 20, 2012, 3:44:37 AM5/20/12
to ang...@googlegroups.com
It seems that regardless of the browser setting and system settings, and regardless of the priority in accept-language headers, the $locale seems to always remain at en-us.
Being a relativ novice in AngularjS, I was wondering if I was missing something... I haven't been able to identify exhaustive localization support documentation, however I might have missed it...  

Pawel Kozlowski

unread,
May 20, 2012, 3:58:22 AM5/20/12
to ang...@googlegroups.com
hi!
You need to include one of the i18n files for your locale from:
http://code.angularjs.org/1.0.0rc9/i18n-1.0.0rc9/
Here is the jsFiddle that shows this in action:
http://jsfiddle.net/pkozlowski_opensource/4tRBY/1/

Hope this helps,
Pawel

Peter Andreas Molgaard

unread,
May 20, 2012, 10:52:51 PM5/20/12
to ang...@googlegroups.com
Hi Pawel,

Thanks... that was the expert advice I was hoping for..

and if I may: quick follow up question... adding dynamic localization support for globally targeted systems not depending on static linking of localization modules, is that somehow supported (e..g through dynamic load during bootstrapping) ?

Thanks again,
Peter

Pawel Kozlowski

unread,
May 21, 2012, 3:10:14 AM5/21/12
to ang...@googlegroups.com
hi Peter!

On Mon, May 21, 2012 at 4:52 AM, Peter Andreas Molgaard
<ma...@petermolgaard.com> wrote:
> Thanks... that was the expert advice I was hoping for..

Glad it helped.

> and if I may: quick follow up question... adding dynamic localization
> support for globally targeted systems not depending on static linking of
> localization modules, is that somehow supported (e..g through dynamic load
> during bootstrapping) ?

I would approach this by doing a landing page on the server side (JSP,
Servlet, PHP, Rails, whatever backend you are using). On this
server-side generated landing page I would inspect incoming headers
and dynamically include an appropriate i18n.js file. Of course you
could have more elaborate locale switch strategy (based on a user
profile for example).

I'm not aware of a sure way of doing this purely on the client side.

Cheers,
Pawel

Felix Hofer

unread,
Mar 12, 2015, 8:53:01 AM3/12/15
to ang...@googlegroups.com
Is there an ability to have Angular respectively the values in date/time inputs and the date time/selectors in local format?

Espen Erlandsen

unread,
Mar 12, 2015, 9:08:31 AM3/12/15
to ang...@googlegroups.com

https://docs.angularjs.org/guide/i18n


tor. 12. mar. 2015, 13.53 skrev Felix Hofer <part...@gmail.com>:
Is there an ability to have Angular respectively the values in date/time inputs and the date time/selectors in local format?

--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Felix Hofer

unread,
Apr 13, 2015, 7:50:28 AM4/13/15
to ang...@googlegroups.com, espen.e...@gmail.com
Yeah I found this too but I think this isn't the solution for my problem (or I didn't get it to work).
Also, in those files I wasn't able to find anything which has to do with date formating. And time formating isn't about localization.

My problem aren't textual translations but the visual representation of dates and times in the input boxes (which are different on different android versions).
And those assignments are done by angular model and the visual result depends on the OS and OS version but it doesn't really respect my language / locale setting of the system.

Too, the native date / time selector dialogs are different on different android versions and one button is german and the other one is english.
On Galaxy S5 I'm not even able to take on my selection since I'm only able to clear or cancel.

1st seems as an Angular problem to me, 2nd seems to be a Cordova bug...?!?



Am Donnerstag, 12. März 2015 14:08:31 UTC+1 schrieb Espen Erlandsen:

https://docs.angularjs.org/guide/i18n

Reply all
Reply to author
Forward
0 new messages