Meta tags:
description= PR Checklist
The commit message follows the project guidelines.
Extended the existing i18n E2E test.
PR Type
Bugfix
What is the current behavior?
In a localized AOT build without additional polyfills, the CLI-generated polyfills bundle only sets the locale and loads Angular locale data. Editing an application translation still changes its URL because esbuild includes the translation-file digest in the filename hash.
Part of #30675; follows the feedback on #34673.
What is the new behavior?
Use the selected locales and their Angular locale data as the hash input for this generated bundle before esbuild assigns the filename. There is still one shared filename across locales, and no output files or imports are rewritten for hashing. Application chunks, workers, user-supplied polyfills, and watch builds retain their current hashing.
Does this PR introduce a breaking change?
No;
Headings (most frequently used words):
uh, oh, navigation, fix, angular, build, keep, generated, locale, polyfills, cacheable, 34721, are, footer, you, diff, view, menu, repository, there, no, files, selected, for, viewing, sure, want, to, change, the, base, filter, by, extension,
Text of the page (most frequently used words):
file (57), #locale (45), expand (44), the (43), const (43), from (34), angular (33), i18n (31), this (28), import (26), build (25), and (25), line (24), for (24), string (24), error (23), await (22), polyfills (21), hidden (21), characters (21), unicode (21), workspaceroot (21), code (19), down (19), data (19), that (18), show (18), all (17), export (17), open (17), github (16), diff (16), src (15), new (15), number (15), resolution (15), request (14), async (14), bidirectional (14), path (14), packages (14), missingtranslation (14), function (13), warning (13), applied (12), translation (12), options (12), inliner (12), change (11), changes (11), name (11), map (11), return (11), tools (11), comments (10), loading (10), esbuild (10), you (9), not (9), reload (9), entry (9), may (9), review (9), learn (9), about (9), view (9), localedata (9), outputpath (8), generated (8), assert (8), contains (8), node (8), text (8), what (8), more (8), promise (8), loadlocaledata (8), suggestion (7), cannot (7), suggestions (7), while (7), application (7), tests (7), original (7), interpreted (7), compiled (7), differently (7), than (7), appears (7), below (7), editor (7), reveals (7), desktop (7), delete (7), edit (7), localize (7), additions (7), i18ninliner (7), i18noptions (7), sign (7), match (6), hashes (6), utils (6), cached (6), localedatacache (6), undefined (6), param (6), filename (6), localizeversion (6), security (5), please (5), commit (5), there (5), readdirsync (5), cacheable (5), lang (5), content (5), output (5), message (5), source (5), set (5), process (5), deletions (5), rawlocaletag (5), loadedlocaledata (5), externalpool (5), pendinglocaledata (5), worker (5), splincode (5), fix (5), base (5), your (5), can (4), pull (4), was (4), page (4), localepolyfills (4), langtranslations (4), each (4), messages (4), length (4), default (4), workspace (4), project (4), bundle (4), failed (4), try (4), projectresolve (4), potentialpath (4), projectroot (4), warnings (4), interface (4), workerpool (4), join (4), type (4), class (4), generation (4), account (4), filter (4), cacheoptions (4), files (4), load (4), keep (4), commits (4), support (4), copilot (4), community (3), footer (3), navigation (3), resolved (3), add (3), batch (3), only (3), retry (3), output_re (3), readfilesync (3), equal (3), get (3), development (3), are (3), array (3), found (3), test (3), record (3), json (3), cli (3), setup (3), main (3), hash (3), e2e (3), ivy (3), catch (3), resolvelocaledatapath (3), cwd (3), tempdir (3), true (3), expect (3), localedir (3), locales (3), basetmpdir (3), ɵparsedtranslation (3), inliner_spec (3), cachekey (3), ignore (3), how (3), handle (3), missing (3), translations (3), with (3), builders (3), hide (3), whitespace (3), 34721 (3), branch (3), refname (3), quality (3), another (3), tab (3), window (3), refresh (3), session (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), contact (2), status (2), privacy (2), terms (2), 2026 (2), merge (2), multi (2), been (2), marked (2), outdated (2), create (2), single (2), one (2), viewing (2), toggle (2), continue (2), groups (2), utf (2), hashing (2), configuration (2), replaceinfile (2), xlf (2), any (2), size (2), appendtofile (2), used (2), projects (2), updatejsonfile (2), getglobalvariable (2), setupi18nconfig (2), env (2), license (2), read (2), readfile (2), utf8 (2), createprojectresolver (2), let (2), returns (2), optional (2), root (2), module (2), resolves (2), maxthreads (2), transformation (2), tasks (2), recursive (2), outputfiles (2), toequal (2), errors (2), common (2), test_tmpdir (2), translationintegrity (2), ephemeral (2), localelist (2), persistentcachepath (2), 144 (2), deletion (2), else (2), diagnostics (2), push (2), stringify (2), inlinelocalize (2), magicstring (2), transformed (2), loadtranslation (2), inlinecode (2), inlinecoderequest (2), inlining (2), oxc (2), when (2), initialoptions (2), conversation (2), have (2), inlinei18n (2), basehref (2), selected (2), apply (2), split (2), unified (2), jump (2), extension (2), tree (2), old (2), could (2), tags (2), branches (2), issue (2), insights (2), actions (2), 196 (2), repository (2), signed (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), business (2), fixes (2), products (2), secret (2), perform, action, time, share, personal, information, manage, cookies, docs, inc, right, now, check, back, later, queued, pending, reviews, has, must, existing, order, valid, applying, deleted, lines, supported, per, subset, closed, invalid, because, were, made, annotations, notes, oops, something, went, wrong, expected, stay, ensure, different, bonjour, salut, translated, without, changing, values, alter, throw, entries, architect, initialization, argv, config, vendor, strict, https, dev, resolving, loaded, script, diagnostic, given, tag, runspy, spyon, run, callthrough, uses, supplied, execute, force, finally, close, findfile, tocontain, browserfile, ___ng_locale_insert___, inlineforlocale, writefile, globalthis, mkdir, node_modules, global, first, second, mkdtemp, workspaces, caches, separately, 1119, 1120, describe, promises, transform, serializetranslation, templateid, 675, 678, activelocales, batchentries, mapblob, 572, 574, 353, 354, initcache, 308, 309, maxconcurrency, i18ninlineroptions, metadata, localeinsertsites, 502, 510, 490, 497, remapped, resolve, being, dictionary, untranslated, target, identifier, 480, 486, escapetemplatepart, part, 319, 324, 286, 290, inlinefilebatch, current, deserializedtranslations, 152, 154, filedatacache, cachedfiledata, whether, should, treated, long, term, inlinefilebatchrequest, passed, createsharedtranslationproxy, reader, traversepostorder, traversal, parsesync, parser, deserialize, unshift, sourcelocale, present, use, directly, hasdefinedsourcelocale, calculatehash, comment, thread, sort, inlinelocales, both, shared, before, assigns, inlines, buildoptions, plugins, watch, startswith, remove, polyfill, inline, shouldinline, 706, 707, getesbuildcommonpolyfillsoptions, componentstylesheetbundler, component, stylesheets, createcompilerplugin, compiler, plugin, angularcompilationcontext, compilation, state, server, rendering, manifest, server_generated_externals, server_app_manifest_filename, enabled, maxinlinerworkers, threaded, prerenderedroutes, prerenderedroutesrecord, conversations, clear, filters, viewed, nbsp, nov, 3d6dbd3, select, changed, checks, 127, wants, into, stable, some, removed, timeline, become, sure, want, nothing, choose, already, clicking, agree, our, occasionally, send, related, emails, statement, service, free, its, maintainers, question, items, requests, issues, dismiss, alert, switched, accounts, out, appearance, settings, search, pricing, event, talks, workshops, next, partners, company, forum, events, webinars, blog, resource, connect, resources, premium, advanced, ons, trust, why, evaluate, see, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, latest, improvements, across, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, environments, codespaces, analysis, enforcement, automation, ship, coding, agent, automated, work, hosting, collaboration, platform, menu, skip,
Text of the page (random words):
e loading please reload this page jump to jump to file failed to load files retry loading uh oh there was an error while loading please reload this page diff view unified split hide whitespace apply and reload show whitespace diff view unified split hide whitespace apply and reload packages angular build src builders application packages angular build src builders application i18n ts i18n ts tools esbuild packages angular build src tools esbuild application code bundle ts application code bundle ts i18n packages angular build src tools i18n i18n inliner worker ts i18n inliner worker ts packages angular build src tools i18n i18n inliner ts i18n inliner ts packages angular build src tools i18n i18n inliner_spec ts i18n inliner_spec ts packages angular build src tools i18n locale data ts locale data ts tests e2e tests i18n tests e2e tests i18n ivy localize hashes ts ivy localize hashes ts there are no files selected for viewing 3 changes 2 additions 1 deletion 3 packages angular build src builders application i18n ts show comments view file edit file delete file open in desktop this file contains hidden or bidirectional unicode text that may be interpreted or compiled differently than what appears below to review open the file in an editor that reveals hidden unicode characters learn more about bidirectional unicode characters show hidden characters original file line number diff line number diff line change expand up 45 7 45 7 export async function inlinei18n warnings string prerenderedroutes prerenderedroutesrecord const i18noptions basehref cacheoptions options const i18noptions basehref cacheoptions workspaceroot options create the multi threaded inliner with common options const inliner new i18ninliner expand all 56 6 56 7 export async function inlinei18n maxinlinerworkers persistentcachepath cacheoptions enabled cacheoptions path undefined localizeversion i18noptions localizeversion workspaceroot workerpool expand down 17 changes 17 additions 0 deletions 17 packages angular build src tools esbuild application code bundle ts show comments view file edit file delete file open in desktop this file contains hidden or bidirectional unicode text that may be interpreted or compiled differently than what appears below to review open the file in an editor that reveals hidden unicode characters learn more about bidirectional unicode characters show hidden characters original file line number diff line number diff line change expand up 19 6 19 7 import server_app_manifest_filename server_generated_externals from utils server rendering manifest import loadlocaledata from i18n locale data import angularcompilationcontext from angular compilation state import createcompilerplugin from angular compiler plugin import componentstylesheetbundler from angular component stylesheets expand down expand up 706 6 707 22 function getesbuildcommonpolyfillsoptions if i18noptions shouldinline remove localize polyfill when i18n inline transformation have been applied to all the packages polyfills polyfills filter path path startswith angular localize if polyfills length 0 options watch buildoptions plugins push name angular locale data hash async setup initialoptions the generated polyfills module only inlines the locale id and locale data not messages account for both in the shared output hash before esbuild assigns the filename const data await promise all array from i18noptions inlinelocales sort map async locale locale await loadlocaledata locale workspaceroot code comment thread splincode marked this conversation as resolved resolved uh oh there was an error while loading please reload this page initialoptions footer js i18n calculatehash json stringify data else if i18noptions hasdefinedsourcelocale when not inlining and a source locale is present use the source locale data directly polyfills unshift angular locale data i18noptions sourcelocale expand down 18 changes 16 additions 2 deletions 18 packages angular build src tools i18n i18n inliner worker ts show comments view file edit file delete file open in desktop this file contains hidden or bidirectional unicode text that may be interpreted or compiled differently than what appears below to review open the file in an editor that reveals hidden unicode characters learn more about bidirectional unicode characters show hidden characters original file line number diff line number diff line change expand up 19 7 19 7 import deserialize from node v8 import parsesync from oxc parser import traversepostorder from oxc traversal import createsharedtranslationproxy from i18n translation reader import loadlocaledata from locale data import type loadedlocaledata loadlocaledata from locale data the options passed to the inliner for each code request expand down expand up 51 6 51 7 export interface inlinecoderequest how to handle missing translations missingtranslation error warning ignore workspaceroot string expand down expand up 89 6 90 7 export interface inlinefilebatchrequest how to handle missing translations missingtranslation error warning ignore workspaceroot string whether the file data should be treated as ephemeral and not cached long term in the worker expand down expand up 152 6 154 8 const filedatacache new map string promise cachedfiledata const deserializedtranslations new map string promise record string ɵparsedtranslation const localedatacache new map string promise loadedlocaledata the current inlining generation for this worker expand down expand up 286 6 290 7 export async function inlinefilebatch locale await loadtranslation locale translation request filename request workspaceroot request missingtranslation expand down expand up 319 6 324 7 export async function inlinecode request inlinecoderequest promise inlinecode request locale await loadtranslation request locale request translation request filename request workspaceroot request missingtranslation expand down expand up 480 6 486 7 function escapetemplatepart part string string param locale the target locale identifier param translation the translation messages dictionary or undefined for untranslated locale param filename the name of the file being transformed param workspaceroot the workspace root used to resolve locale data param missingtranslation how to handle missing translations returns the transformed code optional remapped source map and diagnostics expand all 490 6 497 7 async function inlinelocalize locale string translation record string ɵparsedtranslation undefined filename string workspaceroot process cwd missingtranslation error warning ignore warning const magicstring new magicstring code expand all 502 7 510 13 async function inlinelocalize if metadata localeinsertsites length 0 const localedata await loadlocaledata locale const cachekey json stringify workspaceroot locale let pendinglocaledata localedatacache get cachekey if pendinglocaledata pendinglocaledata loadlocaledata locale workspaceroot localedatacache set cachekey pendinglocaledata const localedata await pendinglocaledata if localedata error diagnostics push type error message localedata error else if localedata warning expand down 6 changes 5 additions 1 deletion 6 packages angular build src tools i18n i18n inliner ts show comments view file edit file delete file open in desktop this file contains hidden or bidirectional unicode text that may be interpreted or compiled differently than what appears below to review open the file in an editor that reveals hidden unicode characters learn more about bidirectional unicode characters show hidden characters original file line number diff line number diff line change expand up 144 6 144 7 export interface i18ninlineroptions maxconcurrency number persistentcachepath string localizeversion string workspaceroot string expand down expand up 308 7 309 7 export class i18ninliner await this initcache const generation this generation const missingtranslation localizeversion this options const missingtranslation localizeversion workspaceroot this options const localelist array from locales if localelist length 0 expand down expand up 353 6 354 7 export class i18ninliner translation translationintegrity translation missingtranslation localizeversion workspaceroot expand down expand up 572 6 574 7 export class i18ninliner map mapblob locales new map batchentries map e e locale e translation missingtranslation this options missingtranslation workspaceroot this options workspaceroot ephemeral activelocales generation expand down expand up 675 6 678 7 export class i18ninliner filename templateid locale missingtranslation this options missingtranslation workspaceroot this options workspaceroot translation await serializetranslation translation translationintegrity expand down 32 changes 32 additions 0 deletions 32 packages angular build src tools i18n i18n inliner_spec ts show comments view file edit file delete file open in desktop this file contains hidden or bidirectional unicode text that may be interpreted or compiled differently than what appears below to review open the file in an editor that reveals hidden unicode characters learn more about bidirectional unicode characters show hidden characters original file line number diff line number diff line change expand up 8 6 8 7 import type ɵparsedtranslation from angular localize import transform from esbuild import assert from node assert import fs from node fs promises import os from node os import path from node path expand down expand up 1119 6 1120 37 describe i18ninliner externalpool undefined it resolves and caches locale data separately for each workspace async const basetmpdir process env test_tmpdir assert basetmpdir test_tmpdir is not set const tempdir await fs mkdtemp path join basetmpdir i18n workspaces externalpool new workerpool maxthreads 1 try for const name of first second const workspaceroot path join tempdir name const localedir path join workspaceroot node_modules angular common locales global await fs mkdir localedir recursive true const localedata globalthis localedata name await fs writefile path join localedir fr js localedata inliner new i18ninliner missingtranslation error workspaceroot externalpool const outputfiles errors warnings await inliner inlineforlocale browserfile polyfills js localize locale ___ng_locale_insert___ fr undefined expect errors toequal expect warnings toequal expect findfile outputfiles polyfills js text tocontain localedata await inliner close finally await fs rm tempdir recursive true force true it uses the supplied workerpool to execute transformation tasks async externalpool new workerpool maxthreads 1 const runspy spyon externalpool run and callthrough expand down 47 changes 16 additions 31 deletions 47 packages angular build src tools i18n locale data ts show comments view file edit file delete file open in desktop this file contains hidden or bidirectional unicode text that may be interpreted or compiled differently than what appears below to review open the file in an editor that reveals hidden unicode characters learn more about bidirectional unicode characters show hidden characters original file line number diff line number diff line change expand up 37 8 37 6 export interface loadedlocaledata error string const localedatacache new map string promise loadedlocaledata resolves the path to the angular locale data file for a given locale tag expand down expand up 98 41 96 28 export function resolvelocaledatapath param projectroot optional project root for module resolution returns a promise resolving to the loaded locale data script code and any diagnostic warnings export function loadlocaledata export async function loadlocaledata rawlocaletag string projectroot string promise loadedlocaledata let cached localedatacache get rawlocaletag if cached cached async const projectresolve createprojectresolver projectroot process cwd const resolution resolvelocaledatapath rawlocaletag potentialpath try return projectresolve potentialpath catch return undefined if resolution error return error resolution error if resolution path try const code await readfile resolution path utf8 const projectresolve createprojectresolver projectroot process cwd const resolution resolvelocaledatapath rawlocaletag potentialpath projectresolve potentialpath return code warning resolution warning catch e return error failed to read locale data file e as error message if resolution error return error resolution error return warning resolution warning if resolution path try const code await readfile resolution path utf8 localedatacache set rawlocaletag cached return code warning resolution warning catch e return error failed to read locale data file e as error message return cached return warning resolution warning 45 changes 39 additions 6 deletions 45 tests e2e tests i18n ivy localize hashes ts show comments view file edit file delete file open in desktop this file contains hidden or bidirectional unicode text that may be interpreted or compiled differently than what appears below to review open the file in an editor that reveals hidden unicode characters learn more about bidirectional unicode characters show hidden characters original file line number diff line number diff line change expand up 6 9 6 12 found in the license file at https angular dev license import as fs from node fs import appendtofile from utils fs import assert from node assert strict import readdirsync readfilesync from node fs import getglobalvariable from utils env import replaceinfile from utils fs import ng from utils process import updatejsonfile from utils project import langtranslations setupi18nconfig from setup const output_re name main vendor d hash a z0 9 js i expand all 17 11 20 27 export default async function setup i18n tests and config await setupi18nconfig const esbuild getglobalvariable argv esbuild if esbuild test the polyfills bundle that contains only the cli generated locale initialization await updatejsonfile angular json workspace workspace projects test project architect build options polyfills build each locale and record output file hashes const hashes new map string string const polyfills new map string name string content string await ng build output hashing all configuration development for const lang outputpath of langtranslations for const entry of fs readdirsync outputpath for const entry of readdirsync outputpath if esbuild polyfills a z0 9 js i test entry polyfills set lang name entry content readfilesync outputpath entry utf 8 const match entry match output_re if match groups continue expand all 36 13 55 27 export default async function throw new error no output entries found alter content of a used translation file await appendtofile src locale messages fr xlf n if esbuild assert equal polyfills size langtranslations length assert equal new set array from polyfills values name name size 1 change a translated message without changing any application source await replaceinfile src locale messages fr xlf bonjour salut build ...
|