What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To deploy multiple locales in Angular, configure a source locale and translation files in angular.json, build the locale variants you need, then serve each variant at a URL that matches its output path and base href. For static hosting, the web server can route the root URL according to the browser’s Accept-Language header and fall back to a default locale. With Angular server rendering and outputMode set to server, Angular can handle that redirect dynamically.
How do I deploy multiple locales in Angular?
The deployment has three parts that must agree: your locale configuration, the generated output directories, and the public URL paths. Angular’s usual static-hosting pattern puts each language in a subdirectory, such as /fr or /es. The server serves the matching variant from that path and can direct visitors from / to a locale based on Accept-Language.
As an Amazon Associate I earn from qualifying purchases.
Angular’s Deploy multiple locales guide includes Nginx and Apache examples. Treat them as starting points: adjust locale matching, the default locale, document root, and single-page application fallback to fit your application and hosting setup.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteConfigure the source locale and translations
In angular.json, identify the source locale and map each target locale to its translation file in the project’s i18n configuration. Angular uses en-US as the default source locale if you have not specified one. Locale identifiers are based on BCP 47 tags, so keep each identifier consistent across configuration, translation files, output paths, and server routing.
#1 Best Overall
Mark translatable text in your templates, then use Angular CLI’s extract-i18n command to create source translation files. Angular supports XLIFF and other translation formats, and lets you choose an output path and filename. After translations are supplied, Angular’s build-time localization process compiles a complete application variant for each selected locale.
For ongoing work shared across a team, an external translation-management workflow may help coordinate content and synchronization. For example, Transifex documents an Angular workflow involving its SDK and command-line tooling. This is optional: Angular’s native build-time localization does not require an external service, and the available documentation does not establish comparative cost, translation quality, or performance.
Rank #2
Build the locale variants you plan to publish
Use the localize build option to choose which configured locales to generate:
- Set
localizetotrueto build all configured locales. - Set it to an array, such as
["fr"], to build only selected locale IDs. - For a one-off build of the configured locales, run
ng build --localize.
Angular places each generated variant in a locale-specific directory under the configured output path, sets the document’s lang attribute, and adjusts the base href for that locale. The deployment guide says ng build defaults to the production configuration.
Rank #3
The Angular development server supports one localized locale at a time; serving several localized variants together with ng serve is not supported. Build the variants you intend to release and publish those generated outputs instead.
Match output paths, base hrefs, and public URLs
For every locale, make the generated directory and the externally visible URL line up. If a variant is generated for a locale subpath, the public site should serve that variant under the corresponding path. Angular adjusts the base href by adding the configured locale subpath. The HTML base tag’s href sets the base URI for relative links, so a mismatch can make navigation or resource paths resolve incorrectly after deployment.
Rank #4
Locale configuration can use baseHref or subPath to customize the path. Use subPath when you need to customize both the output directory and base href; Angular’s workspace reference says that subPath and baseHref cannot be used together on the same locale setting. Check the generated HTML and directory layout against the paths your host actually serves.
If assets must load from a separate compile-time path, Angular provides --deploy-url. It overlaps with base href, so Angular recommends using the base href where possible and reserving --deploy-url for cases that need it.
Choose how visitors reach a locale
| Approach | Where locale selection happens | What you need to configure |
|---|---|---|
| Static locale variants | The web server serves locale-specific output paths and may redirect requests from the root based on Accept-Language. |
Publish each generated variant under its matching path, configure the redirect and default-locale fallback, and adapt the host’s routing and SPA fallback rules. |
| Angular server rendering | With outputMode set to server, Angular handles redirection dynamically based on Accept-Language. |
Use the server-rendered deployment configuration and confirm that the available locale paths and fallback fit the application. |
The documentation describes these approaches but does not provide a general performance or cost comparison. A locale switcher should also take visitors directly to the corresponding locale path rather than assuming that a root-level redirect will select the language they want.
Quick Recap
Check the deployment before release
- Confirm the source locale and each translation-file mapping in
angular.json. - Build all intended locales, or the selected subset, and verify that each has its own generated directory.
- Check each variant’s generated
langattribute and base href. - Open the public URL for each locale directly, not only through the site root, and verify that assets and relative navigation resolve correctly.
- Test the root redirect with a supported browser language and with an unavailable preference; confirm that the latter falls back to your configured default.
- Verify that the server’s locale patterns, document root, and application fallback match your actual deployment rather than copying an example unchanged.
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.




