Skip to content

Conversation

Debatty-Tom
Copy link
Contributor

Solve #71 using a closure to ensure the translation respects the current locale:

Each attribute now uses setAttribute with a closure that calls the translate method. The closures are only executed when the view accesses the attributes, ensuring that the current locale has already been set and translations are rendered correctly.

Copy link
Member

@toonvandenbos toonvandenbos left a comment

Choose a reason for hiding this comment

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

Good one!

However, could you add a comment on the getAttribute() method, indicating why closure are resolved when accessing the attribute? The idea is to explain the translations problem for future maintainers.

@Debatty-Tom Debatty-Tom changed the base branch from main to 2.x October 22, 2025 10:07
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.

2 participants