Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

ci(repository): allow Chinese only in the client's translation catalogs

Kilynaf60ffda2c2b
diff --git a/AGENTS.md b/AGENTS.md
index 00f72901..a2ab2023 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -124,7 +124,9 @@ Memory, and Voice services.
`scripts/local-defaults.env`; `scripts/with-local-env.mjs` only merges files.
- The repository is English-only: docs, code, comments, logs, user-facing
strings, prompts, Skills, tests, fixtures, and benchmark data.
- `make check-repository-gate` rejects CJK ideographs in changed files.
+ `make check-repository-gate` rejects CJK ideographs in changed files. The
+ one exception is the client's translation catalogs under
+ `apps/web/src/i18n/locales/`; text in another language goes nowhere else.
- NO: a test fixture with a literal Chinese sentence.
- OK: the same text as escaped code points (`"\u4f60\u597d"`), or kana,
accented Latin, or emoji when any unspaced script will do.
diff --git a/scripts/ci/check-changed-files.sh b/scripts/ci/check-changed-files.sh
index 0b8f89c4..e327abf6 100755
--- a/scripts/ci/check-changed-files.sh
+++ b/scripts/ci/check-changed-files.sh
@@ -3,7 +3,9 @@ set -euo pipefail
# Formats, lints and checks the English-only rule on the files a change adds
# or modifies. Published built-in Skill versions are immutable and never
-# reformatted.
+# reformatted. The client's translation catalogs under
+# apps/web/src/i18n/locales/ are formatted like any other file and are the one
+# place the English-only rule does not apply.
#
# Usage: check-changed-files.sh <base> <head> diff two commits (the gate)
# check-changed-files.sh <base> --worktree
@@ -41,7 +43,7 @@ fi
prettier_files=()
eslint_files=()
-changed_files=()
+english_only_files=()
while IFS= read -r -d '' file; do
[[ "$file" =~ ^skills/builtin/[^/]+/[^/]+/ ]] && continue
[[ -f "$file" ]] || continue
@@ -62,7 +64,7 @@ while IFS= read -r -d '' file; do
if [[ "$app_lints" == false ]]; then eslint_files+=("$file"); fi
;;
esac
- changed_files+=("$file")
+ [[ "$file" == apps/web/src/i18n/locales/* ]] || english_only_files+=("$file")
done < <(list_changed)
if ((${#prettier_files[@]} > 0)); then
pnpm exec prettier --check "${prettier_files[@]}"
@@ -76,9 +78,9 @@ fi
# git grep exits 1 when nothing matches; any other non-zero status is an error
# (for example a git without PCRE), which must fail the check rather than pass
# it. --untracked lets the local run see files not yet added.
-if ((${#changed_files[@]} > 0)); then
+if ((${#english_only_files[@]} > 0)); then
cjk_status=0
- LC_ALL=C git grep --untracked -nIP '(*UTF)[\x{3400}-\x{4DBF}\x{4E00}-\x{9FFF}\x{F900}-\x{FAFF}]' -- "${changed_files[@]}" || cjk_status=$?
+ LC_ALL=C git grep --untracked -nIP '(*UTF)[\x{3400}-\x{4DBF}\x{4E00}-\x{9FFF}\x{F900}-\x{FAFF}]' -- "${english_only_files[@]}" || cjk_status=$?
if ((cjk_status == 0)); then
echo "Changed files contain Chinese characters; the repository is English-only (see AGENTS.md)." >&2
exit 1
diff --git a/scripts/ci/check-repository-gate.test.ts b/scripts/ci/check-repository-gate.test.ts
index 50d691c5..026672b8 100644
--- a/scripts/ci/check-repository-gate.test.ts
+++ b/scripts/ci/check-repository-gate.test.ts
@@ -182,6 +182,35 @@ describe("local repository gate", { timeout: 60_000 }, () => {
expect(kana.status).toBe(0);
});
+ it("allows CJK ideographs only in the client's translation catalogs", () => {
+ const changedContent = '{ "greeting": "\u4f60\u597d" }\n';
+ const catalog = runGate({
+ changedPath: "apps/web/src/i18n/locales/zh-CN.json",
+ changedContent,
+ });
+ expect(catalog.status).toBe(0);
+ expect(catalog.commands).toContain(
+ "pnpm exec prettier --check apps/web/src/i18n/locales/zh-CN.json",
+ );
+
+ for (const changedPath of [
+ "apps/web/src/i18n/zh-CN.json",
+ "apps/web/src/i18n/locales.json",
+ "apps/desktop/src/i18n/locales/zh-CN.json",
+ ]) {
+ const elsewhere = runGate({ changedPath, changedContent });
+ expect(elsewhere.status).not.toBe(0);
+ expect(elsewhere.stderr).toContain("English-only");
+ }
+
+ const worktree = runGate({
+ worktree: true,
+ changedPath: "apps/web/src/i18n/locales/zh-CN.json",
+ changedContent,
+ });
+ expect(worktree.status).toBe(0);
+ });
+
it("formats and lints only existing changed files outside published Skill versions", () => {
const skill = runGate({
changedPath: "skills/builtin/example/1.0.0/scripts/run.js",