Repository navigation
feat: Filesに出る.knitの種類名を日本語にする - #119
Merged
Merged
Conversation
Localize UTTypeDescription and CFBundleTypeName through ios/App/InfoPlist.xcstrings (Japanese and English) and keep the com.k0mork.knitting-editor.knit identifier unchanged. Check the translations in check-app-bundle.sh and KnittingEditorUTTypeTests. Refs #82 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
K0mork
commented
Oct 6, 2026
K0mork
left a comment
Owner
Author
There was a problem hiding this comment.
レビュー結果
CI
CI and deploy Pagesの必須ジョブはすべて成功し、ci-gateも通った。web・deploy・smokeはiOSだけの変更なのでスキップされた。CodeQLも成功した。
ios (iPhone 17)・ios (iPad (A16)): 成功。KnittingEditorUTTypeTestsの4件が両方の端末で通り、Verify generated app bundle(Debugのアプリへのcheck-app-bundle.sh)も成功した。release_archive: 成功。check-release-assets.sh経由で、Releaseのアーカイブにも新しい検査が通った。app_update (iPhone 17)・app_update (iPad (A16))・ios_web・app_store_docs・changes: 成功。
CIのXcode 26.6でも、文字列カタログからja.lprojとen.lprojのInfoPlist.stringsが作られることを確かめられた。
確かめたこと(問題なし)
- 識別子
com.k0mork.knitting-editor.knitと拡張子knitは変わっていない。KnittingEditorUTType.swiftのexportedAsとも一致し、テストとバンドル検査の両方で固定されている。 project.pbxprojは、XcodeGen 2.46.0でこのブランチのproject.ymlから生成し直したものと一致した。- 開発ログは
docs/dev-log/README.mdの書式どおりで、PR本文の確認内容と食い違いはない。 - 差分・PR本文・コミットメッセージに機密情報は見当たらない。
Refs #82がある。
指摘
- (低)
check-app-bundle.shのコメントが実際と合っていない。 「値に.を含むキーはplutil -extractで引けない」とあるが、棒針編み図バックアップには.が入らず、plutil -extract '棒針編み図バックアップ' rawでバイナリの.stringsからも値を読めた。将来.を含むキーに備えてjqで読むのなら、コメントもその理由に直すとよい。 - (低)英語の経路がCIで実際に通ったかは、ログからは分からない。
testSystemDescribesKnitTypeInTheAppLanguageはpreferredLocalizations.firstから期待値を選ぶので、jaとenのどちらでも通る。CIのSimulatorの言語はログに出ていないので、PR本文と開発ログの「英語の経路はCIで確かめる」は、まだ裏づけられていない。言語をログに出すか、enでの確認を別の形で残すとよい。
利用者の判断が必要な点
en.lprojを入れることの影響。 App Storeの「言語」に英語が出る。また、日本語の端末ではアプリの言語がenからjaに変わるので、ファイル選択の画面やWKWebViewの編集メニューなど、システムの文言も日本語になる見込みである(改善と考えられるが、アプリ内では確かめていない)。Webのコードにはnavigator.languageやIntlを使う処理は無い。#34までenを外すかどうかは判断が要る。- Info.plistに
CFBundleDevelopmentRegionが無いので、日本語でも英語でもない端末ではenになる。後でこのキーを$(DEVELOPMENT_LANGUAGE)(ja)で足すと、そうした端末の挙動が変わる点に注意する。 - PRのタイトルは
fix:だが、ラベルはenhancementである。リリースノートでどちらの区分に入れるかを決めてほしい。 - #82の完了条件のうち、AirDropの受信画面は実機でしか確かめられない。#82に
needs-deviceラベルを付けるとよい。FilesのスクリーンショットもまだPRに付いていない。
修正が必須の問題は見つからなかった。マージの判断は利用者に任せる。
Read each language's InfoPlist.strings file directly in KnittingEditorUTTypeTests so the en.lproj translation is checked regardless of the Simulator language, and log the language used by the localizedDescription test. Look up the translation in check-app-bundle.sh with plutil -extract instead of jq and correct the comment about keys containing a dot. Refs #82 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #82 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
レビューの指摘(低)を直した。
CI( |
…e-name project.pbxproj のコンフリクトは xcodegen generate で作り直して解消した。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-name Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
main での確認
AirDrop の受信画面と Files での種類名の表示は、実機(TestFlight)での確認がまだ残っています。 |
K0mork
added a commit
that referenced
this pull request
Oct 7, 2026
The app now has a Japanese localization (#119), so the Document Picker's close button has the label キャンセル instead of the Cancel identifier on a Japanese simulator. Match either one in the ⌘O shortcut test, and record the merge from main in the development log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
K0mork
added a commit
that referenced
this pull request
Oct 7, 2026
With a localization in the app (#119), the Document Picker's close button loses the Cancel identifier and takes a label in the device language, so the English CI simulator failed too. Also accept the Cancel label and the picker's Browse View (Picker) identifier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
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.
変更内容
iOS版で、Filesの「情報を見る」の「種類」や共有シートに出る
.knitの種類名を日本語にした(これまでは英語のKnitting Editor backup)。ios/App/Info.plist:UTTypeDescriptionとCFBundleTypeNameを棒針編み図バックアップにした。InfoPlist.stringsでは、この値がそのまま訳のキーになる。ios/App/InfoPlist.xcstrings(新規): 日本語棒針編み図バックアップと英語Knitting Chart Backupを持つ文字列カタログ。ビルドすると、アプリにja.lproj・en.lprojのInfoPlist.stringsが入る。ios/knittingEditor.xcodeproj:xcodegen generateで作り直した。差分は、カタログ、テストファイル、knownRegionsのenだけである。com.k0mork.knitting-editor.knitと拡張子knitは変えていない。ios/Tests/KnittingEditorAppTests/KnittingEditorUTTypeTests.swiftを足した。識別子が変わっていないこと、Info.plistの値と訳のキーが一致すること、日本語と英語の訳を確かめる。訳は各言語のInfoPlist.stringsをファイルとして直接読んで比べるので、Simulatorの表示言語に依存せずCIでも英訳を確かめられる。システムが返すlocalizedDescriptionがアプリの表示言語の訳になることも確かめる(実行したSimulatorの表示言語の経路だけで、その言語をログに出す)。ios/scripts/check-app-bundle.shに、ビルドしたアプリの識別子、種類名、ja.lproj・en.lprojの訳の検査を足した。CIのios(Debug)とrelease_archive(Release)で実行される。docs/dev-log/2026-10-06-japanese-knit-type-name.md決めたこと
棒針編み図バックアップにした。アプリ名「棒針編み図」と、編集画面の「バックアップ」の見出しに合わせている。Knitting Chart Backupにした。旧名のKnitting Editor backupはアプリ名を英訳したものである。英語版([P2] 複数言語 #34)でも、ファイルの中身を表す名前のほうが分かりやすいと考えた。InfoPlist.stringsではなく文字列カタログ(InfoPlist.xcstrings)にした。1ファイルで両言語を管理でき、XcodeGen 2.46.0(CIと同じ版)がリソースとして扱える。en.lprojも同梱した。.lprojが1つも無かった。Info.plistにCFBundleDevelopmentRegionも無いので、Foundationは日本語の端末でもアプリの言語をenと判定していた。macOSのFoundationでBundle.preferredLocalizationsを使って確かめた。jaとenを両方持つと、日本語の端末はja、それ以外の端末は今までどおりenになる。日本語だけを持つと、英語の端末でもシステムの文言まで日本語に変わる。.knitを展開して盤面を描く処理を、拡張の中にもう1つ持つ必要がある。完全オフラインのまま保守する負担に比べて、得られるものが小さいと判断した。必要になったらpriority:P2・platform:iosで起票する。実行した確認
手元のXcodeは27.0で、CIの26.6とは異なる。
xcodegen generate --spec ios/project.ymlを実行した。xcodebuild build ... -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NOが成功した。アプリ内のja.lproj/en.lprojのInfoPlist.stringsに、それぞれの訳が入っていることを確かめた。ios/scripts/check-app-bundle.shを実行して通った。わざと壊したコピーでは失敗することも確かめた。壊し方は、英訳の書き換え、ja.lprojの削除、Info.plistの種類名を英語へ戻す変更、識別子の書き換えの4通りである。KnittingEditorUTTypeTestsの4件が通った。このSimulatorの表示言語は日本語なので、localizedDescriptionは日本語の経路だけを確かめた。英語の表示は、下のFilesの確認(-AppleLanguages (en))で確かめた。.knitを「このiPad内」に置き、コミットしない一時的なXCUITestで操作した。-AppleLanguages (ja))では、「情報を見る」の「種類」が棒針編み図バックアップだった。共有シートの見出しは棒針編み図バックアップ · 243 バイトだった。-AppleLanguages (en))では、「種類」がKnitting Chart Backupだった。Knitting Editor backupと出た。ghではPRに画像を添付できないため、添付は利用者に任せた。packages/は変えていないので、Webの検査一式は手元で実行していない。レビュー後の修正
check-app-bundle.sh: 「値に.を含むキーはplutil -extractで引けない」というコメントは事実と合っていなかった。訳のキーには.が無く、plutil -extractでバイナリの.stringsから読めることを確かめたので、jqをやめてplutil -extractで読むようにし、コメントを直した。ビルドしたアプリで通り、わざと壊したコピー6通り(英訳の書き換え、ja.lprojの訳のキーの削除、ja.lproj/en.lprojの削除、Info.plistの種類名、識別子)ではそれぞれ失敗した。testKnitTypeNameIsTranslatedIntoJapaneseAndEnglish:localizedString(forKey:)はキーが無いとキーそのものを返すため、日本語の訳が欠けても通ってしまっていた。Bundle.main.path(forResource: "InfoPlist", ofType: "strings", inDirectory: nil, forLocalization:)で各言語のファイルを直接読んで比べるようにした。testSystemDescribesKnitTypeInTheAppLanguage: 表示言語をログに出すようにした。CIのログにはapp language = enと出た。CIのSimulatorは英語なので、システムが英訳を返す経路はCIで確かめられた(iPhone・iPadの両方)。xcodebuild build-for-testing(Xcode 27.0)とcheck-app-bundle.shを実行した。Simulatorでのテストは手元の負荷のためPRのCIに任せた。できなかった確認
そのため、このPRでは#82を閉じず、残りをIssueにコメントする。
懸念
enを外すかどうかを判断してほしい。外すと、英語の端末ではアプリ内のシステムの文言が日本語になる。Refs #82
🤖 Generated with Claude Code