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
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 27, 2026

Greptile Summary

This PR adds Chinese (zh-CN) language support to the ActivityWatch documentation by introducing translated versions of README, CODE_OF_CONDUCT, and CONTRIBUTING, and prepends language-switcher badges (using shields.io) to the English originals.

  • Three new Chinese markdown files (README.zh.md, CODE_OF_CONDUCT.zh.md, CONTRIBUTING.zh.md) provide complete, professional translations with matching structure and reference links.
  • Three existing English files (README.md, CODE_OF_CONDUCT.md, CONTRIBUTING.md) each receive a two-badge language-switcher row at the top, using correct shields.io image URLs.
  • PR description mismatch: the description also promises vue-i18n installation, locale JSON files, $t() replacements across Vue components, and a UI language switcher — none of which appear in the diff.

Confidence Score: 4/5

Safe to merge as a documentation-only change, but the PR description describes an entire frontend i18n feature that is entirely absent from the diff.

The actual file changes are clean translated Markdown files with no broken links or rendering issues. However, the PR description promises a fully implemented vue-i18n integration — locale JSON files, $t() replacements across Vue components, a Settings language switcher, localStorage persistence, and browser-language auto-detection — none of which exist in the diff. Merging while those items are listed as delivered could mislead maintainers and users into thinking the full feature is shipped.

CONTRIBUTING.zh.md — internal CoC link points to the English file rather than the Chinese translation added in this same PR.

Important Files Changed

Filename Overview
README.md Adds a two-badge language-switcher row at the top using shields.io URLs; no other content changed.
README.zh.md New comprehensive Chinese translation; tagline, ToC, and all sections fully translated; language-switcher badges use correct shields.io format.
CODE_OF_CONDUCT.md Adds language-switcher badge row at the top; no content changes.
CODE_OF_CONDUCT.zh.md New complete Chinese translation of the Contributor Covenant; language-switcher badges use correct shields.io URLs.
CONTRIBUTING.md Adds language-switcher badge row at the top; no content changes.
CONTRIBUTING.zh.md New comprehensive Chinese translation of the contribution guide; internal link to the Code of Conduct still points to the English file rather than the new Chinese version.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User visits GitHub"] --> B{Preferred language?}
    B -->|English| C["README.md\nCODE_OF_CONDUCT.md\nCONTRIBUTING.md"]
    B -->|Chinese| D["README.zh.md\nCODE_OF_CONDUCT.zh.md\nCONTRIBUTING.zh.md"]
    C -->|"zh badge"| D
    D -->|"en badge"| C
    C -->|"Internal link"| E["CODE_OF_CONDUCT.md ✅"]
    D -->|"Internal link"| F["CODE_OF_CONDUCT.md ⚠️ (should be .zh.md)"]
Loading

Reviews (2): 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)

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