Skip to content

Commit cfed2e0

Browse files
committed
Localize settings copy
1 parent b935834 commit cfed2e0

10 files changed

Lines changed: 103 additions & 43 deletions

File tree

Planet/Helper/URLUtils.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ struct AIEndpointSecurityPolicy {
117117
(network: 0xC0A80000, mask: 0xFFFF0000),
118118
]
119119

120-
static let insecureHTTPErrorDescription =
120+
static let insecureHTTPErrorDescription = L10n(
121121
"HTTP AI endpoints are only allowed for localhost, 127.0.0.0/8, 10.0.0.0/8, 100.0.0.0/8, and 192.168.0.0/16. Use HTTPS for other hosts."
122+
)
122123

123124
static func modelsURL(base: String) throws -> URL {
124125
try endpointURL(base: base, pathComponents: ["models"])
@@ -131,13 +132,13 @@ struct AIEndpointSecurityPolicy {
131132
private static func endpointURL(base: String, pathComponents: [String]) throws -> URL {
132133
let trimmedBase = base.trimmingCharacters(in: .whitespacesAndNewlines)
133134
guard let baseURL = URL(string: trimmedBase) else {
134-
throw validationError("Invalid URL")
135+
throw validationError(L10n("Invalid URL"))
135136
}
136137
guard let scheme = baseURL.scheme?.lowercased(), scheme == "http" || scheme == "https" else {
137-
throw validationError("Invalid URL")
138+
throw validationError(L10n("Invalid URL"))
138139
}
139140
guard let host = baseURL.host?.lowercased(), !host.isEmpty else {
140-
throw validationError("Invalid URL")
141+
throw validationError(L10n("Invalid URL"))
141142
}
142143
if scheme == "http" && !isAllowedInsecureHost(host) {
143144
throw validationError(insecureHTTPErrorDescription)

Planet/Settings/PlanetSettingsAIView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ struct PlanetSettingsAIView: View {
166166
isShowingToken.toggle()
167167
} label: {
168168
Label(
169-
isShowingToken ? "Hide API Token" : "Show API Token",
169+
isShowingToken ? L10n("Hide API Token") : L10n("Show API Token"),
170170
systemImage: !isShowingToken ? "eye.slash" : "eye"
171171
)
172172
.labelStyle(.iconOnly)
@@ -392,11 +392,11 @@ struct PlanetSettingsAIView: View {
392392
do {
393393
let (data, response) = try await URLSession.shared.data(for: request)
394394
guard let http = response as? HTTPURLResponse else {
395-
await MainActor.run { setModelStatus(.error("Invalid response")) }
395+
await MainActor.run { setModelStatus(.error(L10n("Invalid response"))) }
396396
return
397397
}
398398
guard http.statusCode == 200 else {
399-
await MainActor.run { setModelStatus(.error("HTTP \(http.statusCode)")) }
399+
await MainActor.run { setModelStatus(.error(L10n("HTTP %d", http.statusCode))) }
400400
return
401401
}
402402
let json = try JSONSerialization.jsonObject(with: data) as? [String: Any]

Planet/Settings/PlanetSettingsGeneralView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ struct PlanetSettingsGeneralView: View {
207207
let alert = NSAlert()
208208
alert.messageText = L10n("Existing Planet Library Found")
209209
alert.alertStyle = .warning
210-
alert.informativeText =
211-
"Would you like to use new library location at: \(url.path), current database including following planets will be replaced with contents at this location."
210+
alert.informativeText = L10n(
211+
"Would you like to use new library location at: %@, current database including following planets will be replaced with contents at this location.",
212+
url.path
213+
)
212214
alert.addButton(withTitle: L10n("Cancel"))
213215
alert.addButton(withTitle: L10n("Continue & Update"))
214216
let result = alert.runModal()

Planet/Settings/PlanetSettingsLayout.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct PlanetSettingsRow<Content: View>: View {
5555

5656
var body: some View {
5757
HStack(alignment: alignment, spacing: PlanetSettingsSharedLayout.columnSpacing) {
58-
Text(title)
58+
Text(L10n(title))
5959
.multilineTextAlignment(.trailing)
6060
.lineLimit(2)
6161
.fixedSize(horizontal: false, vertical: true)
@@ -99,7 +99,7 @@ struct PlanetSettingsDescriptionRow: View {
9999

100100
var body: some View {
101101
PlanetSettingsControlRow(alignment: .top) {
102-
Text(text)
102+
Text(L10n(text))
103103
.font(.footnote)
104104
.foregroundStyle(.secondary)
105105
.frame(maxWidth: .infinity, alignment: .leading)

Planet/en.lproj/Localizable.strings

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,3 +925,22 @@
925925
"Audio" = "Audio";
926926
"Document" = "Document";
927927
"Attachment" = "Attachment";
928+
"Hide API Token" = "Hide API Token";
929+
"HTTP %d" = "HTTP %d";
930+
"HTTP AI endpoints are only allowed for localhost, 127.0.0.0/8, 10.0.0.0/8, 100.0.0.0/8, and 192.168.0.0/16. Use HTTPS for other hosts." = "HTTP AI endpoints are only allowed for localhost, 127.0.0.0/8, 10.0.0.0/8, 100.0.0.0/8, and 192.168.0.0/16. Use HTTPS for other hosts.";
931+
"IPFS Public Gateway" = "IPFS Public Gateway";
932+
"Invalid response" = "Invalid response";
933+
"Invalid URL" = "Invalid URL";
934+
"Show API Token" = "Show API Token";
935+
"Warn before quitting Planet when there are publishing tasks in progress." = "Warn before quitting Planet when there are publishing tasks in progress.";
936+
"When enabled, Planet automatically opens the relevant log window after a publishing error. Off by default." = "When enabled, Planet automatically opens the relevant log window after a publishing error. Off by default.";
937+
"Would you like to use new library location at: %@, current database including following planets will be replaced with contents at this location." = "Would you like to use new library location at: %@, current database including following planets will be replaced with contents at this location.";
938+
"Advanced" = "Advanced";
939+
"Aggregate Now" = "Aggregate Now";
940+
"Contract address of the collection." = "Contract address of the collection.";
941+
"If you want to use a different RPC endpoint, please enter it below." = "If you want to use a different RPC endpoint, please enter it below.";
942+
"Monetization" = "Monetization";
943+
"Please enter the sites you wish to aggregate, listing one per line. You can use ENS (Ethereum Name Service) or IPNS (InterPlanetary Name System) addresses. If you want to aggregate RSS, Atom, or JSON feeds, provide the full URL." = "Please enter the sites you wish to aggregate, listing one per line. You can use ENS (Ethereum Name Service) or IPNS (InterPlanetary Name System) addresses. If you want to aggregate RSS, Atom, or JSON feeds, provide the full URL.";
944+
"Reuse post IDs from the sources if you trust them. This can keep post IDs in URLs consistent." = "Reuse post IDs from the sources if you trust them. This can keep post IDs in URLs consistent.";
945+
"Sites" = "Sites";
946+
"Trust and reuse original IDs" = "Trust and reuse original IDs";

Planet/ja.lproj/Localizable.strings

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
"Choose" = "選択";
169169
"Existing Planet Library Found" = "既存のPlanetライブラリが見つかりました";
170170
"Continue & Update" = "続行して更新";
171-
"General" = "全般";
171+
"General" = "一般";
172172
"Planets" = "Planet";
173173
"Archived My Planet" = "アーカイブした自分のPlanet";
174174
"Archived Following Planet" = "アーカイブしたフォロー中のPlanet";
@@ -385,11 +385,11 @@
385385

386386
"Are you sure you want to delete this post?\n\n%@?\n\nThis action cannot be undone." = "この投稿を削除してもよろしいですか?\n\n%@\n\nこの操作は取り消せません。";
387387

388-
"Would you like to use new library location at" = "次の新しいライブラリの場所を使用しますか:";
388+
"Would you like to use new library location at" = "新しいライブラリの場所を使用しますか:";
389389

390-
"current database including following planets will be replaced with contents at this location" = "フォロー中のPlanetを含む現在のデータベースは、この場所の内容で置き換えられます";
390+
"current database including following planets will be replaced with contents at this location" = "フォロー中のPlanetを含む現在のデータベースは、この場所の内容に置き換えられます。";
391391

392-
"When you tip a creator, transactions will be sent to the selected Ethereum network." = "クリエイターにチップを送ると、選択したEthereumネットワークにトランザクションが送信されます。";
392+
"When you tip a creator, transactions will be sent to the selected Ethereum network." = "クリエイターにチップを送るときは、選択したEthereumネットワークにトランザクションが送信されます。";
393393

394394
"Are you sure you want to archive this planet? Archived planets will not be auto updated. You can later unarchive it from settings." = "このPlanetをアーカイブしてもよろしいですか?アーカイブ済みのPlanetは自動更新されません。後で設定からアーカイブを解除できます。";
395395

@@ -430,7 +430,7 @@
430430
"Address" = "アドレス";
431431
"Addresses" = "アドレス";
432432
"Aggregated from " = "取得元: ";
433-
"Aggregation" = "取り込み";
433+
"Aggregation" = "集約";
434434
"Append" = "末尾に追加";
435435
"Are you sure you want to manually run garbage collection?" = "手動でガベージコレクションを実行してもよろしいですか?";
436436
"Are you sure you want to reset all settings to the default values?" = "すべての設定をデフォルト値に戻してもよろしいですか?";
@@ -440,7 +440,7 @@
440440
"Build Number" = "ビルド番号";
441441
"Build the site to publish the latest changes" = "最新の変更を公開するためにサイトをビルド";
442442
"CID" = "CID";
443-
"Change..." = "変更...";
443+
"Change..." = "変更";
444444
"Chat with AI about this article" = "この記事についてAIとチャット";
445445
"Checking…" = "確認中…";
446446
"Choose a codec and maximum size for this attachment." = "この添付ファイルのコーデックと最大サイズを選択してください。";
@@ -568,7 +568,7 @@
568568
"Open in Terminal" = "ターミナルで開く";
569569
"Open in Tower" = "Towerで開く";
570570
"Open in iTerm" = "iTermで開く";
571-
"Open status in separate window." = "ステータスを別ウィンドウで開きます。";
571+
"Open status in separate window." = "ステータスを別ウインドウで開きます。";
572572
"Option" = "オプション";
573573
"Overwrite" = "上書き";
574574
"PDF" = "PDF";
@@ -581,9 +581,9 @@
581581
"Planet Internal Error" = "Planet内部エラー";
582582
"Play Audio" = "オーディオを再生";
583583
"Please enter an integer" = "整数を入力してください";
584-
"Pop up log window when a publishing error occurs" = "公開エラー時にログウィンドウを表示";
584+
"Pop up log window when a publishing error occurs" = "公開エラー時にログウインドウを表示";
585585
"Preferred Model" = "優先モデル";
586-
"Prevent computer sleep when the app is running" = "アプリ実行中はコンピュータのスリープを防止";
586+
"Prevent computer sleep when the app is running" = "アプリの実行中はコンピュータをスリープさせない";
587587
"Preview" = "プレビュー";
588588
"Previously Used Tags" = "以前使用したタグ";
589589
"Prewarm new post on public gateways" = "新しい投稿をパブリックゲートウェイで事前読み込み";
@@ -664,7 +664,7 @@
664664
"Using Ollama" = "Ollamaを使用中";
665665
"Visit Juicebox Project" = "Juiceboxプロジェクトを開く";
666666
"Wait" = "待つ";
667-
"Warn before quit" = "終了前に警告";
667+
"Warn before quit" = "終了前に警告を表示";
668668
"Welcome to your websites on your Mac" = "Mac上のあなたのWebサイトへようこそ";
669669
"Would you also like to change the app's icon in Finder? This requires granting Planet access to modify its application file." = "Finder上のアプリアイコンも変更しますか?Planetにアプリケーションファイルを変更する権限を与える必要があります。";
670670
"Writer Unsupported Attachment Type Error" = "エディタで未対応の添付ファイルタイプです";
@@ -711,9 +711,9 @@
711711
"API Console" = "APIコンソール";
712712
"API Server Status: **%@**" = "APIサーバーの状態: **%@**";
713713
"Adjusting the plan and continuing..." = "計画を調整して続行しています...";
714-
"Aggregation completed" = "取り込みが完了しました";
715-
"Aggregation failed while publishing %@" = "%@の公開中に取り込みに失敗しました";
716-
"Aggregation failed while rebuilding %@" = "%@の再構築中に取り込みに失敗しました";
714+
"Aggregation completed" = "集約が完了しました";
715+
"Aggregation failed while publishing %@" = "%@の公開中に集約に失敗しました";
716+
"Aggregation failed while rebuilding %@" = "%@の再構築中に集約に失敗しました";
717717
"Apple Intelligence (On-Device)" = "Apple Intelligence(オンデバイス)";
718718
"Apple Intelligence model available" = "Apple Intelligenceモデルを利用できます";
719719
"Applying article edits" = "記事の編集を適用中";
@@ -925,3 +925,22 @@
925925
"Audio" = "オーディオ";
926926
"Document" = "書類";
927927
"Attachment" = "添付ファイル";
928+
"Hide API Token" = "APIトークンを非表示にする";
929+
"HTTP %d" = "HTTP %d";
930+
"HTTP AI endpoints are only allowed for localhost, 127.0.0.0/8, 10.0.0.0/8, 100.0.0.0/8, and 192.168.0.0/16. Use HTTPS for other hosts." = "AIのHTTPエンドポイントは、localhost、127.0.0.0/8、10.0.0.0/8、100.0.0.0/8、192.168.0.0/16でのみ許可されています。その他のホストにはHTTPSを使用してください。";
931+
"IPFS Public Gateway" = "IPFSパブリックゲートウェイ";
932+
"Invalid response" = "無効な応答";
933+
"Invalid URL" = "無効なURL";
934+
"Show API Token" = "APIトークンを表示する";
935+
"Warn before quitting Planet when there are publishing tasks in progress." = "公開タスクの実行中にPlanetを終了しようとすると、警告を表示します。";
936+
"When enabled, Planet automatically opens the relevant log window after a publishing error. Off by default." = "オンにすると、公開エラーの発生後に関連するログウインドウを自動的に開きます。デフォルトではオフです。";
937+
"Would you like to use new library location at: %@, current database including following planets will be replaced with contents at this location." = "新しいライブラリの場所(%@)を使用しますか?現在のデータベース(フォロー中のPlanetを含む)は、この場所の内容に置き換えられます。";
938+
"Advanced" = "詳細";
939+
"Aggregate Now" = "今すぐ集約";
940+
"Contract address of the collection." = "コレクションのコントラクトアドレスです。";
941+
"If you want to use a different RPC endpoint, please enter it below." = "別のRPCエンドポイントを使用する場合は、以下に入力してください。";
942+
"Monetization" = "収益化";
943+
"Please enter the sites you wish to aggregate, listing one per line. You can use ENS (Ethereum Name Service) or IPNS (InterPlanetary Name System) addresses. If you want to aggregate RSS, Atom, or JSON feeds, provide the full URL." = "集約するサイトを1行に1つずつ入力してください。ENS(Ethereum Name Service)またはIPNS(InterPlanetary Name System)のアドレスを使用できます。RSS、Atom、JSONフィードを集約する場合は、完全なURLを入力してください。";
944+
"Reuse post IDs from the sources if you trust them. This can keep post IDs in URLs consistent." = "ソースを信頼する場合は、ソースの投稿IDを再利用します。これによりURL内の投稿IDの一貫性を保てます。";
945+
"Sites" = "サイト";
946+
"Trust and reuse original IDs" = "元のIDを信頼して再利用する";

Planet/versioning.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CURRENT_PROJECT_VERSION = 2765
1+
CURRENT_PROJECT_VERSION = 2766

0 commit comments

Comments
 (0)