angular/angular-cli · warning

Locale data for '${locale}' cannot be found. No locale data

Error message

Locale data for '${locale}' cannot be found. No locale data will be included for this locale.

What it means

During i18n build configuration, if neither the full locale nor its primary-language fallback has locale data available, the CLI warns that no locale data will be included in the build for that locale, and the translation descriptor gets no dataPath.

Source

Thrown at packages/angular_devkit/build_angular/src/utils/i18n-webpack.ts:80

  for (const [locale, desc] of Object.entries(i18n.locales)) {
    if (!i18n.inlineLocales.has(locale) && locale !== i18n.sourceLocale) {
      continue;
    }

    let localeDataPath = findLocaleDataPath(locale, localeResolver);
    if (!localeDataPath) {
      const [first] = locale.split('-');
      if (first) {
        localeDataPath = findLocaleDataPath(first.toLowerCase(), localeResolver);
        if (localeDataPath) {
          context.logger.warn(
            `Locale data for '${locale}' cannot be found. Using locale data for '${first}'.`,
          );
        }
      }
    }
    if (!localeDataPath) {
      context.logger.warn(
        `Locale data for '${locale}' cannot be found. No locale data will be included for this locale.`,
      );
    } else {
      desc.dataPath = localeDataPath;
    }

    if (!desc.files.length) {
      continue;
    }

    loader ??= await createTranslationLoader();

    loadTranslations(
      locale,
      desc,
      context.workspaceRoot,
      loader,
      {

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Correct the locale ID in your i18n configuration to one Angular supports (run e.g. by listing Angular's known locales).
  2. Register the custom locale data with registerLocaleData from a locale data file before/at build configuration.
  3. Remove the locale from the build if translations are not actually needed for it.

Example fix

// before (angular.json)
"locales": { "de-DE": "src/locale/messages.de.xlf" }
// after
"locales": { "de": "src/locale/messages.de.xlf" }
Defensive patterns

Strategy: validation

Validate before calling

import localeDe from '@angular/common/locales/de';
import { registerLocaleData } from '@angular/common';
// Verify locale resolves before adding to angular.json
const known = (await import('@angular/common/locales/global/README.md').catch(() => null)) !== null;
if (!known) registerLocaleData(localeDe); // or fix the locale ID in angular.json

Prevention

When it happens

Trigger: configureI18nBuild with a locale where findLocaleDataPath returns null for both the full tag and the lowercased first subtag (e.g. an unknown/custom locale like 'zz' or a misspelled ID).

Common situations: Typo'd locale codes in angular.json; custom synthetic locales; locales removed/renamed between Angular versions; using locale IDs Angular has no registry entry for.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/910fa5e8b54135ad. Report an issue: GitHub.