Do not document language as a fixed set of codes - #4
Merged
Conversation
added 2 commits
August 14, 2026 22:11
The widget resolves the language against the translations it actually ships and uses English for anything else, so no code is invalid. Naming en/cs/sk in the docs implied a whitelist and would go stale with every language added.
Unknown language falls back to the browser language first, then English -- not straight to English.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ConfOptions::$languageandsnippet($language)are documented asAvailable: en, cs, sk. That reads as a whitelist, which the library does not enforce and cannot enforce — the widget resolves the language against the translation bundles it actually ships and uses English for anything else. No code is invalid, and the list goes stale the moment a language is added.What
Docs only, no behaviour or signature change:
#[Docs]onConfOptions::$language, thesnippet()docblock and both README spots now say that any language code is accepted and one without a translation falls back to English.Tests
139 tests,
composer caclean.