activitywatch icon indicating copy to clipboard operation
activitywatch copied to clipboard

feat: add Chinese i18n support with vue-i18n

Open WanderLandWalker opened this issue 6 months ago • 3 comments

This PR adds Chinese (zh) language support to ActivityWatch:

  • Installs vue-i18n for Vue 2
  • Creates en.json and zh.json locale files
  • Replaces hardcoded English strings with () calls across all views and components
  • Adds language switcher in Settings → Theme
  • Persists language preference to localStorage
  • Auto-detects browser language on first visit
  • Adds Chinese translations for README, CODE_OF_CONDUCT, CONTRIBUTING with language switcher badges

WanderLandWalker avatar May 27 '26 05:05 WanderLandWalker

Greptile Summary

This PR adds Chinese (Simplified) language support to ActivityWatch's documentation by introducing Chinese translations of README, CODE_OF_CONDUCT, and CONTRIBUTING, and appending shields.io language-switcher badges to each existing English file.

  • Three new Chinese Markdown files (README.zh.md, CODE_OF_CONDUCT.zh.md, CONTRIBUTING.zh.md) provide full translations, including a translated Mermaid architecture diagram and comparison tables.
  • Three existing English files (README.md, CODE_OF_CONDUCT.md, CONTRIBUTING.md) each receive a single two-badge language-switcher line at the top using proper shields.io image URLs.
  • Two internal cross-links in the Chinese files still point to the English originals instead of the newly added Chinese versions.

Confidence Score: 5/5

Safe to merge — all changes are documentation only, with no impact on application code or runtime behaviour.

The entire diff is additive Markdown content. The three existing files receive only two new badge lines each, and the three new Chinese translation files are standalone documents. No application logic, build configuration, or data is touched.

README.zh.md and CONTRIBUTING.zh.md contain cross-links that point to the English versions of documents that now have Chinese translations.

Important Files Changed

Filename Overview
README.md Adds two lines of shields.io language-switcher badges at the top; no other changes to existing content.
README.zh.md New full Chinese translation of the README; cross-link in the contribution section points to English CONTRIBUTING.md instead of CONTRIBUTING.zh.md.
CODE_OF_CONDUCT.md Adds two lines of shields.io language-switcher badges at the top; no other changes to existing content.
CODE_OF_CONDUCT.zh.md New Chinese translation of the Code of Conduct; content is complete and all links are correct.
CONTRIBUTING.md Adds two lines of shields.io language-switcher badges at the top; no other changes to existing content.
CONTRIBUTING.zh.md New Chinese translation of the contributing guide; the code-of-conduct section links to English CODE_OF_CONDUCT.md instead of CODE_OF_CONDUCT.zh.md.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens README.md / README.zh.md] --> B{Language badge clicked?}
    B -- "en badge" --> C[README.md]
    B -- "zh-CN badge" --> D[README.zh.md]
    C --> E{Internal link clicked?}
    D --> F{Internal link clicked?}
    E -- CONTRIBUTING link --> G[CONTRIBUTING.md]
    E -- CODE_OF_CONDUCT link --> H[CODE_OF_CONDUCT.md]
    F -- CONTRIBUTING link --> I[CONTRIBUTING.md - should be .zh.md]
    G --> K{Language badge?}
    K -- zh-CN --> L[CONTRIBUTING.zh.md]
    L -- CODE_OF_CONDUCT link --> M[CODE_OF_CONDUCT.md - should be .zh.md]

Reviews (3): Last reviewed commit: "fix: use shields.io badges for language ..." | Re-trigger Greptile

greptile-apps avatar May 27 '26 06:05 greptile-apps

Yes, I really need this feature too.

ant-cave avatar Jun 10 '26 08:06 ant-cave

@greptile-apps review

0xbrayo avatar Jun 10 '26 10:06 0xbrayo