Repository navigation
Localize the desktop host's menu and connection screen in four languages - #421
Merged
Merged
Conversation
yansfil
force-pushed
the
feat/i18n-desktop-host
branch
from
October 5, 2026 01:33
15e23aa to
373ead5
Compare
The shell sends the core's explicit choice over the host bridge once per change, and the command titles the native menu needs live in a module the host's main process can import without the shell's store.
The app menu and its role items, the connection screen, the folder picker and the browser display dialogs read the interface catalogs. The host keeps the last core-confirmed explicit choice in its profile and resolves an unset choice from the system language, so the menu and the connection screen are right before any daemon answers.
yansfil
force-pushed
the
feat/i18n-desktop-host
branch
from
October 5, 2026 02:51
373ead5 to
ea5a74f
Compare
The browser view tests build the host with an English translator, the page bridge mock carries reportLanguage, and the fixture exports REPO again for the CDP spec that imports it.
yansfil
added a commit
that referenced
this pull request
Oct 5, 2026
…aywright), lock regenerated by pnpm
yansfil
added a commit
that referenced
this pull request
Oct 5, 2026
…coded text (#464) 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 | | --- | --- | --- | --- | |  |  |  |  | |  |  |  |  | 캡션: 같은 폰의 목록과 대화 상세를 네 언어로 본 것(데스크톱 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가 코드를 보내게 바꿀지 결정이 필요하다(#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만 돌렸다. <details><summary>Verification record</summary> base 523f89b(#421 머지), 커밋 3개(daemon·서비스 워커, 폰 페이지, 가드와 문서). `eslint-plugin-i18next`를 web devDependency로 추가했다. 폰의 한국어 문구 목록은 위 Review에 있다. 이 PR이 #339의 마지막이다: #386(기반), #415(웹 셸), #421(데스크톱 호스트). </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #339 (3개 중 두 번째: 웹 셸 나머지 #415 머지됨 / 데스크톱 호스트 / 폰·푸시와 재발 방지 검사)
Summary
데스크톱 호스트(Electron)가 직접 그리는 문구를 네 언어 catalog(
native.*,commands.*)로 옮겼다. 동작, 레이아웃, 상태 모델은 그대로다.앱 메뉴(File/Edit/View/Pane/Window/Help)와 시스템 role 항목(Undo, Quit, Services 등), 연결 화면, 폴더 선택 대화상자, 브라우저 표시의 오류 문구와 앱 링크 확인 대화상자가 대상이다.
core가 언어 선택을 가지므로, 셸이 확정된 값을
hideHost.reportLanguage로 한 번씩 알리고 호스트는 마지막 값을 프로필(interface-language.json)에 둔다. 그래서 daemon이 답하기 전에도 메뉴와 연결 화면이 맞는 언어로 나온다. 미설정이면 호스트가 시스템 언어를 직접 푼다.캡션:
hide명령이 없을 때의 연결 화면을 네 언어로 본 것(실제 Electron 창 캡처).Review
role: "windowMenu"에 최소화/확대·축소/모두 앞으로 가져오기만 명시했다(기존 role이 넣던 항목과 같다).desktop/src/main/language.ts- 저장된 선택은 core가 확정한 값만 받고(report는 네 언어 또는 null 외에는 거부), 못 읽는 파일은 로그에 남기고 선택 없음으로 읽는다.desktop/src/main/host.ts- 연결 화면은 bridge가 없어서 문구를 주소 query로 받는다. 언어가 바뀌면 연결 화면만 다시 불러오고, daemon 화면은 건드리지 않는다(languageChanged).desktop/src/main/menu.ts,index.ts- 메뉴 캐시 키에 언어가 들어가 언어가 바뀔 때만 다시 만든다. main process는 번역기와 catalog만 import하고 셸의 store나 React 모듈은 끌어오지 않는다(web/src/commandTitle.ts로 분리).Evidence
desktop/e2e/language.spec.ts6건 통과 - 네 언어 각각의 저장된 선택으로 daemon 없이 연결 화면과 메뉴 라벨, 선택 없음일 때 시스템 언어(ja)와 미지원 언어(fr은 영어), Settings에서 고른 언어가 메뉴를 다시 그리고 저장되며 시스템으로 되돌아오는 흐름.desktop.spec,add-project.spec,browser.spec도 통과. 격리된 profile, state, Herdr만 사용했고 운영자의 앱은 건드리지 않았다.Menu객체 라벨로 확인했다.Verification record
base 50fc965(#415 머지), 커밋 2개(셸의 언어 보고 + 호스트 문구).
i18next를 desktop devDependency로 추가했다(TFunction타입 import용, 런타임 번들은 그대로 web의 번역기를 쓴다).HIDE_DESKTOP_SYSTEM_LANGUAGE를 env 레지스트리에 추가했고 e2e fixture는en-US로 고정한다.