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
- Correct the locale ID in your i18n configuration to one Angular supports (run e.g. by listing Angular's known locales).
- Register the custom locale data with registerLocaleData from a locale data file before/at build configuration.
- 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
- Cross-check every locale in angular.json i18n.locales against Angular's supported locale list.
- Avoid typos by generating i18n configuration via schematics rather than hand edits.
- Treat this warning as an error in CI builds to catch bad locale IDs early.
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
- The development server only supports localizing a single loc
- Locale data for '${locale}' cannot be found. Using locale da
- No project name provided and no default project found in wor
- Option "project" is required.
- Project is not defined in this workspace.
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/910fa5e8b54135ad.
Report an issue: GitHub.