feat: add LanguageSwitcher β€” community Chinese translation link

#4
by xilanhua12138 - opened

Summary

Adds a reusable LanguageSwitcher.astro component that displays available translations in the article metadata section.

Changes

  • New: app/src/components/LanguageSwitcher.astro β€” accessible nav component
  • Modified: app/src/components/Hero.astro β€” accepts optional translations prop
  • Modified: app/src/pages/index.astro β€” reads translations from article frontmatter
  • Modified: app/src/content/article.mdx β€” links to community Chinese translation

Usage

Add to any article's frontmatter:

translationsLabel: "Available in"
translations:
  - lang: en
    label: English
    url: https://openevals-evaluation-guidebook.hf.space
    flag: "πŸ‡ΊπŸ‡Έ"
    current: true
  - lang: zh
    label: δΈ­ζ–‡
    url: https://xilanhua12138.github.io/evaluation-guidebook-cn/
    flag: "πŸ‡¨πŸ‡³"

Chinese Translation

Links to a complete community Chinese translation:
πŸ‡¨πŸ‡³ https://xilanhua12138.github.io/evaluation-guidebook-cn/

Sign up or log in to comment