Skip to content

Do not document language as a fixed set of codes - #4

Merged
stromcom merged 2 commits into
masterfrom
docs/language-any-code
Aug 14, 2026
Merged

Do not document language as a fixed set of codes#4
stromcom merged 2 commits into
masterfrom
docs/language-any-code

Conversation

@stromcom

Copy link
Copy Markdown
Owner

Why

ConfOptions::$language and snippet($language) are documented as Available: 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] on ConfOptions::$language, the snippet() 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 ca clean.

stromek 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.
@stromcom
stromcom merged commit eac9fa2 into master Aug 14, 2026
2 checks passed
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