Skip to content

feat: Add multilingual (i18n) support with Chinese translation#8

Open
zengbinli wants to merge 7 commits into
bigearth:masterfrom
zengbinli:feat/i18n-multilingual-support
Open

feat: Add multilingual (i18n) support with Chinese translation#8
zengbinli wants to merge 7 commits into
bigearth:masterfrom
zengbinli:feat/i18n-multilingual-support

Conversation

@zengbinli

Copy link
Copy Markdown

Multilingual Support for BITBLOG

Adds internationalization (i18n) structure to BITBLOG following Jekyll's standard multilingual pattern, as suggested in issue #2.

Changes

  1. _config.yml — Added languages list (en, zh) and default_lang setting
  2. _i18n/zh.yml — Chinese translation strings for navigation, footer, and UI elements
  3. _includes/language-switcher.html — Reusable language switcher component (🌐 EN | 中文)
  4. _layouts/default.html — Updated with lang attribute on <html> tag and language switcher in header
  5. index.zh.md — Chinese homepage at /zh/ with filtered Chinese posts
  6. _posts/2026-04-21-multilingual-support-zh.md — Sample Chinese blog post
  7. assets/css/language-switcher.css — Styling for the language switcher

How it works

  • Each post/page has a lang field in its front matter (defaults to en)
  • The language switcher appears in the header, linking between / (English) and /zh/ (Chinese)
  • Adding a new language is as simple as:
    1. Add the language to languages in _config.yml
    2. Create a translation file in _i18n/
    3. Create an index page (e.g., index.ja.md)
    4. Add posts with the corresponding lang field

To add more languages

Follow the same pattern — create _i18n/ja.yml, index.ja.md, and posts with lang: ja.

Closes #2

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.

Build a multilingual website with jekyll

1 participant