Skip to content

FIX: Resolve i18n calls at render time instead of class instantiation#286

Merged
ZogStriP merged 1 commit intomainfrom
fix-module-level-i18n-call
Feb 25, 2026
Merged

FIX: Resolve i18n calls at render time instead of class instantiation#286
ZogStriP merged 1 commit intomainfrom
fix-module-level-i18n-call

Conversation

@ZogStriP
Copy link
Member

@ZogStriP ZogStriP commented Feb 25, 2026

The modelTypes class field initializer calls i18n() when the class is instantiated, capturing translations at that point. This prevents Site Text overrides from being reflected since the array is built once and reused.

Convert the class field to a getter so the translations are resolved fresh each time the property is accessed.

Core fix - discourse/discourse#37041

The modelTypes class field initializer calls i18n() when the class is
instantiated, capturing translations at that point. This prevents Site
Text overrides from being reflected since the array is built once and
reused.

Convert the class field to a getter so the translations are resolved
fresh each time the property is accessed.
Copy link
Contributor

@pmusaraj pmusaraj left a comment

Choose a reason for hiding this comment

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

Thanks @ZogStriP

@ZogStriP ZogStriP merged commit e0b44c9 into main Feb 25, 2026
6 checks passed
@ZogStriP ZogStriP deleted the fix-module-level-i18n-call branch February 25, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants