Skip to content

feat: add i18n support with English and Chinese language toggle - #2

Merged
JinxiangChen22 merged 1 commit into
mainfrom
add-i18n
May 6, 2026
Merged

feat: add i18n support with English and Chinese language toggle#2
JinxiangChen22 merged 1 commit into
mainfrom
add-i18n

Conversation

@JinxiangChen22

Copy link
Copy Markdown
Owner

What did I change?

  • Added a frontend-only i18n system with English/Chinese language toggle
  • Created static/locales/en.json and static/locales/zh.json for translations
  • Created static/js/i18n.js to swap text and persist language in localStorage
  • Tagged all UI text in homepage views with data-i18n attributes
  • Added a language toggle button to the navbar

Why did I change it?

  • Baseline Standard 4 (Internationalization) requires a working toggle for at least two languages

What code changed?

  • New: static/locales/en.json, static/locales/zh.json, static/js/i18n.js
  • Modified: views/partials/nav.ejs (toggle button), hero.ejs, feature.ejs, achievements.ejs, footer.ejs (data-i18n attributes)
  • Modified: views/index.ejs (load i18n.js)

Results

  • Language toggle works on the homepage
  • Button shows current language (EN / 中文)
  • Selected language persists across page reloads via localStorage

@vercel

vercel Bot commented May 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
taskify Ready Ready Preview, Comment May 6, 2026 6:04am

@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@JinxiangChen22
JinxiangChen22 merged commit d464f28 into main May 6, 2026
4 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