question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locale change not working since upgrade to Module

See original GitHub issue

I’ve recently upgraded a project to angular 2 final and found that a locale change on moment doesn’t change the displayed lang using am pipes.

I’ve used the suggestions from #26 but still have the issue. import * as moment from 'moment'; import 'moment/min/locales';

I’ve created an example here: plunkr

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rafalkasacommented, Oct 15, 2016

Hi

I’m using current version with angular2 NgModule and for me everything is working. If you want to use different locale you should import in your class eg. app.component.ts

import * as moment from 'moment';
import 'moment/locale/pl';

    constructor() {   
        moment.locale('pl'); 
    }

Please look at closed issue #20

0reactions
urishcommented, Oct 17, 2016

@kghaghada my bad, for some reason I omitted this from the changelog. Added now: https://github.com/urish/angular2-moment/commit/eb60960509ec77e3221d1f36ae4ceb8641aa006e

and this is the relevant issue: #73

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - changes in locale does work when add many modules
We use Crowdin (this lib apply a wrapper above context). The app works perfectly when only is a single module. Use Appcompat:1.2. When...
Read more >
Localization update does not update configuration translations
Add a language. Enable Locale module. Go to report > Translation updates and run a translation update. Observe: Configuration translations are ...
Read more >
How do I fix my locale issue? - Ask Ubuntu
First run locale to list what locales currently defined for the current user account: $ locale LANG=C LANGUAGE= LC_CTYPE=fi_FI.
Read more >
Not work import modules in locales files after add hooks to ...
Not work import modules in locales files after add hooks to core after latest package upgrade · Issue #835 · nuxt-modules/i18n · GitHub....
Read more >
Your current server locale setting does not work - ProcessWire
Note: Your current server locale setting does not work as expected with the UTF-8 character set and may cause minor problems.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found