Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale is not loaded automatically when using ng build, but it is when using ng serve #54320

Closed
JustDoItSascha opened this issue Feb 7, 2024 · 4 comments
Labels
area: docs Related to the documentation area: i18n
Milestone

Comments

@JustDoItSascha
Copy link

          The corresponding locale is not loaded by default, you need to do it yourself. 
import localeEnGB from '@angular/common/locales/en-GB';
registerLocaleData(localeEnGB );

Originally posted by @JeanMeche in #51534 (comment)

We had the same error like in the issue above. When I look into the current docs, there is no mentioning of registerLocaleData anymore. How should one know that this is still necessary?

@JustDoItSascha JustDoItSascha changed the title The corresponding locale is not loaded by default, you need to do it yourself. Locale is not loaded automatically when using ng build, but it is when using ng serve Feb 7, 2024
@ngbot ngbot bot added this to the needsTriage milestone Feb 7, 2024
@JeanMeche
Copy link
Member

JeanMeche commented Feb 7, 2024

registerLocaleData is required if you don't leverage the CLI to setup i18n or if you don't import from locales/global like for example '@angular/common/locales/global/fr'.

Do you mind sharing a github repo repro of a project with the mentionned issue.

@JeanMeche JeanMeche added the needs reproduction This issue needs a reproduction in order for the team to investigate further label Feb 7, 2024
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Feb 7, 2024
@JustDoItSascha
Copy link
Author

The issue is not in a project. The issue is, that the information "registerLocaleData is required if you don't leverage the CLI" is not documented in the angular docs. The registerLocaleData is not mentioned a single time.

The i18n section of angular docs is just focussing on the translation part, which is still more than bad in angular. But it's not mentioning a way to just change the locale which I think is a more important feature.

@JeanMeche JeanMeche added area: docs Related to the documentation and removed needs reproduction This issue needs a reproduction in order for the team to investigate further labels Feb 11, 2024
@ngbot ngbot bot modified the milestones: Backlog, needsTriage Feb 11, 2024
@alan-agius4
Copy link
Contributor

Let’s continue tracking this as part of #46851

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: docs Related to the documentation area: i18n
Projects
None yet
Development

No branches or pull requests

4 participants