1. Concepts

Internationalization using ngx-translate

Version: 1.x

Content SDK's Angular implementation provides internationalization (i18n) support across three areas:

  • Dictionary-based translations - integrates with the ngx-translate library to enable translations via Sitecore dictionaries. All ngx-translatefeatures are supported, including TranslatePipe. Translations resolve based on the current route's locale.
  • Multi-language page content rendering - renders page content in the language matching the current route locale, fetching the appropriate language version from your Sitecore instance.
  • Locale-aware router links - automatically applies the locale prefix to links on the page when the current route includes a supported locale in the URL.

Configuring internationalization

You can configure internationalization behavior in sitecore.config.ts:

Setting

Environment variable

Description

defaultLanguage

CSDK_PUBLIC_SITECORE_DEFAULT_LANGUAGE

Sets the default language for to load pages and dictionaries for your site.

angular.locales

N/A

Lists the languages supported by the app.

Locale resolution behavior

The angular.locales setting determines which URL prefixes are recognized as locale identifiers. For example, if locales is set to ['en', 'da']:

  • da/About and en/About are parsed as locale links and resolve content in the corresponding language.
  • da-DK/About resolves to a 404 unless da-DK is explicitly listed in angular.locales or exists as a routable page in your Sitecore deployment.
If you have suggestions for improving this article, let us know!