Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk3 min

Angular Locale IDs: Choose and Configure the Right Setting

Angular locale IDs combine language and regional conventions. Learn when to set the source locale, configure LOCALE_ID, override a pipe, and load locale data.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Angular, refer to a locale with a Unicode locale identifier such as en-CA or fr-FR. Choose a tag that matches both the language and regional conventions your users need, then configure the app’s LOCALE_ID and ensure the corresponding locale data is available. Locale choice affects formats such as dates, numbers, percentages and currency; it is not merely a language label.

What an Angular locale ID means

Angular locale IDs are based on Unicode locale identifiers, which use conventions from BCP 47 and Unicode CLDR. The regional part can distinguish conventions within the same language: en-CA is English for Canada, while en-US is English for the United States; similarly, fr-CA and fr-FR identify French for Canada and France. Angular uses the identifier to find locale data for internationalization of text strings and formatting.

As an Amazon Associate I earn from qualifying purchases.

Those distinctions can affect grammar, punctuation, dates, decimal separators and currency conventions. Select the locale that matches the intended audience rather than assuming one language tag is suitable for every region. Angular’s guide explains the identifier conventions and examples in Refer to locales by ID.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which locale setting should you use?

Angular has related locale settings for different purposes. The build’s source locale identifies the original language of the application; the LOCALE_ID provider supplies the application locale used by Angular’s documented runtime features. A pipe can also receive an explicit locale for an individual formatting operation.

Setting What it controls Where to configure it
Source locale The source language of the application for the localization build workflow The i18n section of angular.json; Angular documents en-US as the default source locale. See the locale-ID guide.
LOCALE_ID The application locale used by Angular’s documented locale-sensitive pipes, ICU expressions and i18n extraction Provide the token in application providers or during module-based bootstrap. See the token reference.
Pipe-level locale A one-operation override when a particular formatting result should use another locale Pass a locale argument to CurrencyPipe. See Format data based on locale.

These settings are not interchangeable: use the source locale for the build’s source-language configuration, the provider for the app-wide locale, and a pipe override only when a specific operation intentionally differs.

Set the application locale with LOCALE_ID

Provide LOCALE_ID with the desired locale string. For example, this provider sets the app locale to Canadian English:

{ provide: LOCALE_ID, useValue: 'en-CA' }

In a standalone application, put the provider in the application providers. In a module-based application, provide the token in the bootstrap configuration, following the pattern in Angular’s LOCALE_ID API reference. Replace en-CA with the identifier appropriate for your users.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What LOCALE_ID changes in formatting

Angular documents DatePipe, CurrencyPipe, DecimalPipe and PercentPipe as using LOCALE_ID. The token also applies to ICU expressions and i18n extraction. If only one currency display needs a different locale, provide that locale directly to CurrencyPipe; that explicit argument overrides the app-wide token for that call. Angular describes these behaviors in Format data based on locale.

Make locale data available

Angular includes en-US locale data initially. When using Angular’s localized CLI builds with --localize, the CLI automatically includes locale data and sets LOCALE_ID for the localized build. The documented command is:

ng build --localize

For other use cases, Angular provides global locale variants under @angular/common/locales/global. For example, to import the global French variant:

import '@angular/common/locales/global/fr';

Angular also provides registerLocaleData for registering locale data for Angular’s internal use. Choose the appropriate approach for the app’s build and runtime setup; see the official guides for global locale variants and the registerLocaleData API.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose and verify a locale

  1. Identify the audience’s language and region. Decide whether the product needs a regional variant such as en-CA rather than a broader or different English locale.
  2. Set the source locale if you are configuring localization builds. Use the workspace i18n configuration in angular.json.
  3. Provide the app locale. Set LOCALE_ID to the selected identifier where the application is configured.
  4. Load the needed data. Use the localized build workflow or an applicable locale-data import or registration.
  5. Check representative output. Verify dates, numbers, percentages, currency, punctuation and language conventions against the expectations of the intended audience.

Angular’s documentation defines the available configuration mechanisms, but it does not prescribe a locale for a particular product or market. Confirm the output against the conventions your application actually needs.

Use Intl rather than relying on getLocaleId for new i18n work

Angular’s getLocaleId API reference marks the function deprecated since v18.0 and recommends the JavaScript Intl API for internationalization. For new i18n code, consult the getLocaleId API reference and use Intl where appropriate rather than treating getLocaleId as the preferred modern approach.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.