Skip to content

refactor: Decouple and deprecate core locale, plumb via catalog factory#1610

Open
jacobsimionato wants to merge 3 commits into
a2ui-project:mainfrom
jacobsimionato:refactor/localize-basic-catalog-locale
Open

refactor: Decouple and deprecate core locale, plumb via catalog factory#1610
jacobsimionato wants to merge 3 commits into
a2ui-project:mainfrom
jacobsimionato:refactor/localize-basic-catalog-locale

Conversation

@jacobsimionato

Copy link
Copy Markdown
Collaborator

Description

This Pull Request decouples the locale parameter from core models (SurfaceModel and DataContext) and plumbs it directly via a localized basic catalog function factory inside @a2ui/web_core/v0_9/basic_catalog.

By deprecating the legacy, core-level parameters and providing a localized factory (createBasicCatalogFunctions), we:

  1. Ensure the core rendering layer remains lightweight, catalog-agnostic, and unburdened by layout/formatting preferences.
  2. Maintain full backward compatibility for existing catalogs and standard default functions (BASIC_FUNCTIONS).
  3. Add native support for localizing basic catalogs downstream (such as in @a2ui/angular's options).

Fixes #1609

Pre-launch Checklist

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors locale configuration by moving it from the surface/context level to the catalog level. It introduces factory functions (such as createBasicCatalogFunctions) to allow instantiating catalog functions with a specific locale, while deprecating the legacy locale properties on DataContext and SurfaceModel. Feedback on these changes highlights that the subclass BasicCatalog in Angular has a parameterless constructor, which prevents configuring the locale when it is injected via Angular DI. It is recommended to update BasicCatalog to accept options via an InjectionToken to support proper dependency injection configuration.

Comment thread renderers/angular/src/v0_9/catalog/basic/basic-catalog.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web_core] Decouple locale parameter from core models and plumb via basic catalog function factory

1 participant