Skip to content

Support intermediate (non-leaf) translation keys#609

Merged
TitasGailius merged 2 commits into
mainfrom
intermediate-translation-keys
Mar 13, 2026
Merged

Support intermediate (non-leaf) translation keys#609
TitasGailius merged 2 commits into
mainfrom
intermediate-translation-keys

Conversation

@TitasGailius
Copy link
Copy Markdown
Collaborator

Intermediate translation keys like __('validation.attributes.question') now produce clickable links, hovers, and no false diagnostics. Previously only leaf keys like __('validation.attributes.question.email') worked.

This adds a startsWith fallback in getTranslationItemByName. If an exact key match isn't found, it checks whether any registered key starts with the given key followed by a dot, confirming the intermediate key is valid.

This is a continuation of #324

@TitasGailius TitasGailius merged commit faae4fe into main Mar 13, 2026
@TitasGailius TitasGailius deleted the intermediate-translation-keys branch March 13, 2026 10:31
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.

1 participant