@salesforce/ui-bundle-features 12.3.13 → 12.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/features.json +62 -0
  2. package/package.json +1 -1
@@ -1,5 +1,67 @@
1
1
  {
2
2
  "features": {
3
+ "angular-language-switcher": {
4
+ "name": "Angular Language Switcher",
5
+ "package": "@salesforce/ui-bundle-template-feature-angular-language-switcher",
6
+ "shortDescription": "B2X language switcher for Angular that rewrites the URL language segment and reloads the page",
7
+ "longDescription": "A drop-in <app-language-switcher /> control for public B2X (Experience) Angular apps. It renders a labeled <select> of the site's supported languages; selecting one rewrites the current URL so the chosen language becomes the first path segment after basePath, then reloads the page at that new URL. A full reload lets the platform serve the correctly localized content — the feature owns only URL rewriting, not translation loading or i18n state. The current language is read from globalThis.SFDC_ENV.language, falling back to a default when absent or unrecognized. The list of available languages is hardcoded (in languages.ts) and manually kept in sync with the site's digitalExperiences/site/<siteName>/sfdc_cms__languageSettings/content.json, since there is no runtime API to read language settings on a published site. For LOCAL DEVELOPMENT, the feature integrates with the site entry of @salesforce/angular-plugin-ui-bundle: switch your middleware/html.mjs to import @salesforce/angular-plugin-ui-bundle and pass the supported LANGUAGES, and the dev server will inject SFDC_ENV.language and a language-prefixed basePath per request (mirroring production) so switching works locally without a server restart. This feature is intended for B2X apps only; B2E (internal) apps derive language from the logged-in user's profile and have no language URL segment.",
8
+ "keywords": [
9
+ "angular",
10
+ "language",
11
+ "language switcher",
12
+ "locale",
13
+ "localization",
14
+ "i18n",
15
+ "b2x",
16
+ "url"
17
+ ],
18
+ "featureDependencies": [],
19
+ "packageDependencies": {
20
+ "@angular/core": "^21.2.0",
21
+ "@angular/router": "^21.2.0"
22
+ },
23
+ "copy": [
24
+ {
25
+ "from": "force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher",
26
+ "to": "<uiBundleDir>/src/app/features/language-switcher",
27
+ "description": "Language switcher library: LanguageSwitcherComponent, hardcoded language list, and the pure buildLanguageUrl URL-rewriting utility"
28
+ },
29
+ {
30
+ "from": "force-app/main/default/uiBundles/feature-angular-language-switcher/src/types/globals.d.ts",
31
+ "to": "<uiBundleDir>/src/types/language-switcher-globals.d.ts",
32
+ "description": "Ambient augmentation adding the optional SFDC_ENV.language field the switcher reads"
33
+ },
34
+ {
35
+ "from": "force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/__examples__/language-switcher-example.ts",
36
+ "to": "<uiBundleDir>/src/app/features/language-switcher/__examples__/language-switcher-example.ts",
37
+ "description": "Example showing how to mount <app-language-switcher /> in an app header/layout",
38
+ "integrationTarget": "src/app/components/layout/app-layout/app-layout.ts"
39
+ },
40
+ {
41
+ "from": "force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/__examples__/html-middleware-site-example.ts",
42
+ "to": "<uiBundleDir>/src/app/features/language-switcher/__examples__/html-middleware-site-example.ts",
43
+ "description": "Example showing how to switch middleware/html.mjs to the @salesforce/angular-plugin-ui-bundle entry so language switching works in local dev (inject SFDC_ENV.language + language-prefixed basePath)",
44
+ "integrationTarget": "middleware/html.mjs"
45
+ }
46
+ ],
47
+ "features": [
48
+ "Rewrites the URL so the chosen language is the first path segment after basePath, then reloads",
49
+ "Replaces an existing known language segment instead of stacking a new one",
50
+ "Serves the default language un-prefixed: switching to it removes the language segment",
51
+ "Preserves the rest of the path, the query string, and the hash when rewriting",
52
+ "Reads the current language from SFDC_ENV.language with a safe default fallback",
53
+ "Hardcoded language list kept in sync with the site's sfdc_cms__languageSettings content.json",
54
+ "No-ops when the selected language already matches the current one",
55
+ "Local dev: integrates with @salesforce/angular-plugin-ui-bundle to inject SFDC_ENV.language + a language-prefixed basePath per request, so switching works locally without a server restart"
56
+ ],
57
+ "components": [
58
+ "LanguageSwitcherComponent - Standalone Angular component with labeled <select> that switches language via URL rewrite + reload",
59
+ "buildLanguageUrl - Pure helper that inserts/replaces/removes the leading language path segment",
60
+ "getCurrentLanguage - Resolves the active language from SFDC_ENV with default fallback",
61
+ "LANGUAGES - Typed list of supported languages ({ code, label })",
62
+ "DEFAULT_LANGUAGE - Default language code used when SFDC_ENV.language is missing/unknown"
63
+ ]
64
+ },
3
65
  "cms-toolkit": {
4
66
  "name": "CMS Toolkit",
5
67
  "package": "@salesforce/ui-bundle-template-feature-cms-toolkit",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-features",
3
- "version": "12.3.13",
3
+ "version": "12.4.0",
4
4
  "description": "CLI tool for searching and installing UI features into Salesforce UI Bundles",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "type": "module",