Skip to content

feat: add Chinese i18n support with vue-i18n#1310

Open
WanderLandWalker wants to merge 2 commits into
ActivityWatch:masterfrom
WanderLandWalker:feat/chinese-i18n
Open

feat: add Chinese i18n support with vue-i18n#1310
WanderLandWalker wants to merge 2 commits into
ActivityWatch:masterfrom
WanderLandWalker:feat/chinese-i18n

Conversation

@WanderLandWalker

Copy link
Copy Markdown

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

@greptile-apps

greptile-apps Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

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]
Loading

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

Comment thread README.zh.md Outdated
Comment on lines +5 to +8
<p align="center">
<b>Records what you do</b> so that you can <i>know how you've spent your time</i>.
<br>
All in a secure way where <i>you control the data</i>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Untranslated tagline in Chinese README

The introductory paragraph retained its English text (Records what you do…, All in a secure way…) and was never translated. A reader looking at this file for a Chinese-language version will encounter English text immediately below the banner, undermining the purpose of the translation.

Comment thread README.md Outdated
@@ -1,3 +1,5 @@
[![en](README.md)](/README.md) | [![zh](README.zh.md)](/README.zh.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 The badge syntax [![en](README.md)](/README.md) uses a Markdown file path as the image source. GitHub cannot render a .md file as an image, so both badges will display as broken-image icons. Use shields.io URLs (or plain text links) instead so the language switcher actually renders.

Suggested change
[![en](README.md)](/README.md) | [![zh](README.zh.md)](/README.zh.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](/README.md) | [![zh](https://img.shields.io/badge/lang-zh--CN-yellow.svg)](/README.zh.md)

Comment thread CODE_OF_CONDUCT.md Outdated
@@ -1,3 +1,5 @@
[![en](CODE_OF_CONDUCT.md)](/CODE_OF_CONDUCT.md) | [![zh](CODE_OF_CONDUCT.zh.md)](/CODE_OF_CONDUCT.zh.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Same broken-image badge issue as in README.md.md files cannot be used as image sources in Markdown badge syntax, so this switcher will display broken icons on GitHub.

Suggested change
[![en](CODE_OF_CONDUCT.md)](/CODE_OF_CONDUCT.md) | [![zh](CODE_OF_CONDUCT.zh.md)](/CODE_OF_CONDUCT.zh.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](/CODE_OF_CONDUCT.md) | [![zh](https://img.shields.io/badge/lang-zh--CN-yellow.svg)](/CODE_OF_CONDUCT.zh.md)

Comment thread CONTRIBUTING.md Outdated
@@ -1,3 +1,5 @@
[![en](CONTRIBUTING.md)](/CONTRIBUTING.md) | [![zh](CONTRIBUTING.zh.md)](/CONTRIBUTING.zh.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Same broken-image badge issue — .md files cannot serve as image sources, so both language switcher badges will render as broken icons on GitHub.

Suggested change
[![en](CONTRIBUTING.md)](/CONTRIBUTING.md) | [![zh](CONTRIBUTING.zh.md)](/CONTRIBUTING.zh.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](/CONTRIBUTING.md) | [![zh](https://img.shields.io/badge/lang-zh--CN-yellow.svg)](/CONTRIBUTING.zh.md)

Comment thread README.zh.md Outdated
@@ -0,0 +1,251 @@
[![English](README.md) | ![中文](README.zh.md)](README.zh.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 The badge format here differs from CODE_OF_CONDUCT.zh.md and CONTRIBUTING.zh.md. The outer wrapper [... | ...](README.zh.md) creates a single link around both images (with a literal pipe character), and the "English" badge also has a broken image source. The other Chinese files correctly use two independent clickable badge links separated by |. Additionally all image sources should be shields.io URLs.

Suggested change
[![English](README.md) | ![中文](README.zh.md)](README.zh.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](/README.md) | [![zh](https://img.shields.io/badge/lang-zh--CN-yellow.svg)](/README.zh.md)

Comment thread CODE_OF_CONDUCT.zh.md Outdated
@@ -0,0 +1,48 @@
[![English](CODE_OF_CONDUCT.md)](/CODE_OF_CONDUCT.md) | [![中文](CODE_OF_CONDUCT.zh.md)](/CODE_OF_CONDUCT.zh.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Same broken-image badge issue — CODE_OF_CONDUCT.md and CODE_OF_CONDUCT.zh.md are not image files and will render as broken icons on GitHub.

Suggested change
[![English](CODE_OF_CONDUCT.md)](/CODE_OF_CONDUCT.md) | [![中文](CODE_OF_CONDUCT.zh.md)](/CODE_OF_CONDUCT.zh.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](/CODE_OF_CONDUCT.md) | [![zh](https://img.shields.io/badge/lang-zh--CN-yellow.svg)](/CODE_OF_CONDUCT.zh.md)

Comment thread CONTRIBUTING.zh.md Outdated
@@ -0,0 +1,118 @@
[![English](CONTRIBUTING.md)](/CONTRIBUTING.md) | [![中文](CONTRIBUTING.zh.md)](/CONTRIBUTING.zh.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Same broken-image badge issue — CONTRIBUTING.md and CONTRIBUTING.zh.md are not image files and will render as broken icons on GitHub.

Suggested change
[![English](CONTRIBUTING.md)](/CONTRIBUTING.md) | [![中文](CONTRIBUTING.zh.md)](/CONTRIBUTING.zh.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](/CONTRIBUTING.md) | [![zh](https://img.shields.io/badge/lang-zh--CN-yellow.svg)](/CONTRIBUTING.zh.md)

@ant-cave

Copy link
Copy Markdown

Yes, I really need this feature too.

@0xbrayo

0xbrayo commented Jun 10, 2026

Copy link
Copy Markdown
Member

@greptile-apps review

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.

3 participants