Skip to content

Conversation

@liberaldev
Copy link
Contributor

This pull request adds comprehensive tests for the to_html_lang filter, and improves language code handling and accessibility in the language selector. It has the nature of reinforcing #3718.

Testing and filter correctness:

  • Added a new test file test/test_plugin_html_lang.rb to thoroughly test the Jekyll::HtmlLangFilter#to_html_lang method, ensuring correct conversion from Jekyll locale format (e.g., zh_cn) to BCP 47 format (e.g., zh-CN), proper handling of non-string inputs, and integration with Liquid templates. This test code was generated using RubyMine's Junie. This facilitates maintenance.

Language selector accessibility and semantics:

  • Updated the language selector in _includes/language_selector.html to wrap language codes with <span lang="und-Latn"> and <span lang="en"> for English, improving accessibility and semantic correctness.

@liberaldev liberaldev requested a review from a team as a code owner December 24, 2025 14:05
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