Add a test that every copy key in code exists in both locales
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 83/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react-native, typescript
- Lĩnh vực
- internationalization, testing
Hướng nghiên cứu
Read apps/mobile/src/a11y-scan.ts and its test for the scanner shape, then packages/copy/src/index.ts for KEY_PATTERN. Add tests in apps/mobile/src/copy-keys.test.ts and cover .ts and .tsx sources under the specified directories, following apps/mobile/src/skill-names.test.ts for package traversal. Run pnpm --filter @hermit/mobile test; done when missing keys are reported with their file names and both locale files are checked.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Why
Every string a person sees is a key in packages/copy (AGENTS.md rule 9), and the translator throws on a missing key, so a misspelled key breaks its screen at run time. Nothing checks that the keys the code names exist (VISION.md, principle 5: Spanish and English, first-class).
What to do
Today the copy tests check that both locale files have the same keys and placeholders, and a scan finds about 1,700 literal key references in apps/mobile/src and packages/*/src, all of which resolve. This test guards against the next typo.
- Test first. Create
apps/mobile/src/copy-keys.tswith a pure function that takes a source file's text and returns the copy keys written in it as whole string literals (in double quotes, single quotes, or backticks with no${). UseKEY_PATTERNfrom@hermit/copy(packages/copy/src/index.ts). Follow the shape ofapps/mobile/src/a11y-scan.tsand its test. - In
apps/mobile/src/copy-keys.test.ts, test the function on made-up source text: a literal key is found; a key built at run time from a template is skipped; a string that isn't a key is skipped. Watch it fail before the function exists. - Add a test that reads every
.tsand.tsxfile underapps/mobile/src(skipping*.test.ts) and underpackages/*/src, collects the keys, and checks that each one is in bothpackages/copy/locales/en.jsonandes-419.json. Name the file and the key for each one missing.apps/mobile/src/skill-names.test.tsshows how to walkpackages/*/src. - Check that it can fail: misspell one key in a screen on your machine, run the test, see it name the file and the key, then undo the change.
Done when
pnpm --filter @hermit/mobile testruns the new tests and they pass.- A misspelled key in any screen or package makes the test fail and name the file and the key.
How to check
pnpm --filter @hermit/mobile test
(cd apps/mobile && node --test --experimental-strip-types src/copy-keys.test.ts)
Keep in mind
- Keys built at run time, like the Device lab's
HM-SET-10.failed.followed by a reason, are out of scope. Don't guess them. apps/sitehas its own locale files. Leave it out.- No change to the locale files or the screens, unless the test finds a key that is really missing. Then add it to both locales, with no em or en dashes.
- Ngôn ngữ chính
- TypeScript
- Star
- 11
- Fork
- 0
- Merge trung bình
- 10 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DojoCodingLabs/hermit
-
docs good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
DojoCodingLabs/hermit#73 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
device-lab
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
DojoCodingLabs/hermit#45 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
device-lab
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
DojoCodingLabs/hermit#44 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
device-lab
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DojoCodingLabs/hermit#43 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-friendly docs good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
DojoCodingLabs/hermit#39 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DojoCodingLabs/hermit
Issue tương tự
-
bug zoo
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
software-mansion/runntime#151 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
sidebandstudio/clawtrate#728 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement github_actions help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tranquilo-art/tranquilo-app#254 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Tfoucher5/fuzzy-toolkit#44 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug tooling
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
endora-commerce/endora-commerce#1978 ·
Maintainer thường phản hồi trong vòng 1 ngày