Skip to content

Localize the phone app and push notifications, and guard against hardcoded text - #464

Merged
yansfil merged 4 commits into
mainfrom
feat/i18n-phone-push
Oct 5, 2026
Merged

yansfil merged 4 commits into
mainfrom
feat/i18n-phone-push

Conversation

@yansfil

@yansfil yansfil commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Closes #339 (마지막 PR: 웹 셸 #415, 데스크톱 호스트 #421은 머지됨)

Summary

폰 화면과 푸시 알림을 네 언어 catalog로 옮기고, 제품 문구가 catalog 밖에 새로 생기면 pnpm lint가 잡도록 했다. 동작, 레이아웃, 상태 모델은 그대로다.
폰은 snapshot이 없어서 daemon이 core의 명시적 선택을 agents frame의 interface_language로 알려 주고, 선택이 없으면(그리고 첫 frame 전의 연결 화면은) 폰의 브라우저 언어를 쓴다.
푸시 문장은 이제 daemon이 만들지 않는다. payload는 에이전트 제목, 장소, 상태(needs_you/done)만 싣고, 서비스 워커가 페이지가 맡겨 둔 상태 단어(Cache API)와 장소를 합쳐서 알림을 그린다. 앱이 닫혀 있어도 맞는 언어로 나온다.

en ko zh-CN ja
en ko zh-CN ja
en ko zh-CN ja

캡션: 같은 폰의 목록과 대화 상세를 네 언어로 본 것(데스크톱 Settings에서 고른 core 언어를 폰이 따라간다). 에이전트 제목, 요청 줄, 대화 본문은 사용자 데이터라 번역되지 않는다.

Review

  • 판단해 주세요: 폰의 한국어 문구 일부가 catalog의 ko 문구로 바뀐다. <Mac>와 연결 -> <Mac>에 연결, pane -> 페인, 설정 > Mobile -> 설정 > 모바일, 답장... -> 답장…. 영어 locale의 폰은 이전에 한국어였고 이제 catalog 영어다. 되돌리려면 catalog ko/en 값만 고치면 된다.
  • 판단해 주세요: manifest.webmanifest의 한국어 description을 지웠다. 정적 파일이라 언어를 따라갈 수 없고, 설치 화면은 name을 쓴다.
  • 판단해 주세요: 하드코딩 가드는 두 규칙이다. i18next/no-literal-string은 JSX 텍스트와 사람이 읽는 속성의 문장을, no-restricted-syntax는 제품 코드의 모든 문자열에서 한글·한자·가나를 잡는다. 허용 목록(키캡 이름, 제품 이름, 기호, 단위, 예시 경로)은 web/eslint.config.js에 이유와 함께 있고 인라인 disable은 쓰지 않는다. .ts helper가 반환하는 영어 문장은 이 가드가 보지 못한다(리뷰 몫, docs/LOCALIZATION.md에 적었다).
  • 조심해서 볼 파일: hided/src/mobile/push.rs, web/public/m/sw.js - payload가 body 대신 state/place를 싣는다. 단어를 한 번도 저장하지 못한 구독(이 변경 전에 만든 것)은 단어 없이 장소만 보인다. 영어를 지어내지 않는다.
  • 조심해서 볼 파일: web/src/i18n/translator.tsx, client.tsx - 두 페이지가 공유하는 번역기를 셸 store 없이 분리했다. 폰 번들은 아직 StartSheet가 끌어오는 공유 모듈(layer.ts, terminals.ts 등)로 셸 store에 닿는다. 이전부터 그랬고 이 PR은 건드리지 않았다.
  • 질문: core가 문장으로 보내는 문구는 아직 번역되지 않는다. 폰 시작 화면의 대상 이름("This Mac", "Home", hided/src/mobile/start.rs), 사람 전달 알림의 영어 문장(push_delivery, 지금은 장소 자리에 그대로 실린다), 셸의 status_label·reason. core가 코드를 보내게 바꿀지 결정이 필요하다(Localize the web shell's remaining screens in four languages #415, #421과 같은 질문).

Evidence

  • 확인한 것: web typecheck/lint, web vitest 109 파일 1030건, hided mobile Rust 테스트 47건과 clippy/fmt(위 변경 기준), node --check sw.js, check-no-workstation-identity.sh.
  • 확인한 것: 격리된 후보 hided와 사설 Herdr에서 mobile.spec 3건과 interface-language.spec 2건 통과 - 폰이 데스크톱 Settings에서 고른 core 언어(ko, 시스템으로 복귀)를 따라가고, 만료된 코드 안내가 ko 폰에서 한국어로 나오고, 푸시 payload에 body가 없고 state/place가 있으며, 서비스 워커의 hide-phone-words 캐시에 두 단어가 저장된다.
  • 확인한 것: 같은 스택에서 폰 목록과 상세를 네 언어로 캡처해 줄바꿈과 잘림을 확인했다(위 표).
  • 확인한 것: 가드 자체는 guard.test.ts가 샘플 소스로 검증한다(영어 JSX 텍스트·속성, 세 문자 체계의 CJK, 허용 목록, 카탈로그 제외).
  • 전수 점검: web 비테스트 소스 전체를 JSX 텍스트, 읽는 속성, CJK 문자, helper의 영어 문구로 훑었다. 나온 것은 장치 라벨 fallback 둘(startTargets.ts, search.ts, 이제 catalog)뿐이다. 남은 영어는 단축키 registry의 title(검색 키이자 commandTitle이 대체하는 영어 원본), 진단 문구, 에이전트 kind 이름이다. 린트는 web/src 전체에서 0건이다.
  • 확인하지 못한 것: 실제 기기의 푸시 수신(Web Push 서비스를 거치는 알림)은 확인하지 못했다. payload와 서비스 워커의 본문 조립은 loopback push endpoint와 vm 시뮬레이션으로 확인했다.
  • 확인하지 못한 것: 폰 화면 확인은 브라우저 안의 iPhone 크기 터치 페이지다. 홈 화면에 추가한 PWA와 iOS 글꼴은 확인하지 못했다.
  • 확인하지 못한 것: web e2e 전체는 CI에 맡겼다. 로컬에서는 폰, 언어, 팔레트, 디스크 정리 등 바뀐 문구를 건드리는 spec만 돌렸다.
Verification record

base 523f89b(#421 머지), 커밋 3개(daemon·서비스 워커, 폰 페이지, 가드와 문서). eslint-plugin-i18next를 web devDependency로 추가했다. 폰의 한국어 문구 목록은 위 Review에 있다. 이 PR이 #339의 마지막이다: #386(기반), #415(웹 셸), #421(데스크톱 호스트).

…phone

The agents frame carries the core's explicit interface language, and a push
payload names the agent's state and place instead of a Korean body. The service
worker keeps the page's two state words in its own cache and composes the
notification in the language the phone shows; the manifest drops its static
Korean description.
The phone resolves the core's explicit choice from the agents frame (its own
browser language before the first one), and every sentence it shows comes from
the catalogs. Failures and refusals stay a key plus values in the store so a
shown line follows a language change; the page tells the service worker the
words a notification needs.
An ESLint rule flags English JSX text and read attributes, another flags
Korean, Chinese and Japanese characters in any product string, and a test keeps
both from quietly going silent. The two device-label fallbacks the audit found
read the catalog now, and the localization guide describes the phone, the push
payload and the guard.
The e2e size budget main added holds the phone spec to its baseline: the
language-follow and words-cache checks moved into the empty-list test.
@yansfil
yansfil merged commit 85ec00f into main Oct 5, 2026
28 checks passed
@yansfil
yansfil deleted the feat/i18n-phone-push branch October 5, 2026 05:46
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.

i18n 적용과 영어·한국어·중국어·일본어 기본 지원

1 participant