* feat(editor): add setting to turn off spellcheck underlines Add a device-local "Underline spelling mistakes" switch to the editing preferences. The rich-text editor and the mobile plain-text editor now set spellcheck from this preference and update live when it changes. Defaults to enabled, so existing behavior is unchanged. Refs #468 * feat(i18n): add Polish as an in-app locale Add Polish (pl) across clients, mirroring how Japanese was added: - Shared: full pl catalog, locale matching for pl/pl-*, Polish memo templates and factory AI prompts, mobile editor strings, and Polish as an AI translation target and selection-translate chip. - Web: "Polski" in the language picker; the catalog is lazy-loaded in its own i18n-pl chunk and kept out of the PWA precache like ja. - Android: pl locale option, mobile-only strings, web-clip labels. Messages that only had an English branch now use English for every non-Chinese locale, so Japanese no longer falls back to Chinese there. - iOS: .polish UI language (pl-PL), pl argument for every t() call, pl in CFBundleLocalizations and Localizable.xcstrings. - Companion: accepts locale "pl" and detects Polish requests. - Browser extension: _locales/pl messages. - Marketing site: /pl/ pages, hreflang, sitemap, language switcher. - Google Play listing copy for pl-PL (manual publish only). * fix(ios): show the note editor in Polish and Japanese The iOS editor received every interface language except English as Chinese, so with Polish or Japanese selected its toolbar and image gallery controls were labeled in Chinese. Pass Polish and Japanese through to the embedded editor, label its toolbar and the shared image gallery controls in both languages, and rebuild the checked-in EditorBundle. The Android editor uses the same gallery labels. Also translate the last iOS strings that had no Polish text: the follow-system language label, note created/updated times and the current-device marker. Refs #473 * fix(companion): recognize Polish typed without diacritics Requests in Latin letters without Polish diacritics were always treated as English, so with a Polish interface "Napisz plan na jutro" got an English reply. With a Polish interface, such text is now told apart by common English and Polish words; when it is still unclear, the recent conversation and then the interface language decide. Other interface languages keep treating Latin text as English. Refs #473 * chore(ios): regenerate the Xcode project for Polish Run xcodegen so the shipped Info.plist lists Polish in CFBundleLocalizations and the project knows the pl region. The hand-written AiDirectStream.swift entries are replaced by the IDs xcodegen generates. MARKETING_VERSION and CURRENT_PROJECT_VERSION stay in the project file because the release script and Xcode Cloud update them there. Refs #473 * i18n(pl): translate the sidebar shortcut, desktop menus and video scope Add Polish for features that reached main while this branch was open: the show/hide sidebar shortcut label, the desktop application and editing context menus, and the new "ai:generate" MCP scope. The desktop menus switch to Polish for pl and pl-* locales; other locales are unchanged. Refs #473
57 lines
2.3 KiB
Swift
57 lines
2.3 KiB
Swift
import SwiftUI
|
|
|
|
/// Minimal conflict UI: discard local queue item and rehydrate from server.
|
|
struct ConflictResolutionView: View {
|
|
@Environment(AppEnvironment.self) private var env
|
|
let item: OutboxItem
|
|
var onResolved: () -> Void
|
|
|
|
@State private var busy = false
|
|
@State private var error: String?
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 12) {
|
|
Text(env.preferences.t("同步冲突", en: "Sync conflict", pl: "Konflikt synchronizacji")).font(.headline)
|
|
Text(env.preferences.t(
|
|
"本地草稿与服务器版本不一致。你可以丢弃本地更改并采用云端内容,或稍后再处理。",
|
|
en: "The local draft differs from the server version. Discard local changes and use the cloud version, or resolve it later.",
|
|
pl: "Lokalny szkic różni się od wersji na serwerze. Odrzuć lokalne zmiany i użyj wersji z chmury lub rozwiąż to później."
|
|
))
|
|
.font(.subheadline)
|
|
.foregroundStyle(.secondary)
|
|
if let err = item.lastError {
|
|
Text(err).font(.caption).foregroundStyle(.red)
|
|
}
|
|
if let error {
|
|
Text(error).font(.caption).foregroundStyle(.red)
|
|
}
|
|
HStack {
|
|
Button(env.preferences.t("丢弃本地", en: "Discard local", pl: "Odrzuć lokalne")) {
|
|
Task { await discardLocal() }
|
|
}
|
|
.buttonStyle(.borderedProminent)
|
|
.tint(.red)
|
|
.disabled(busy)
|
|
Button(env.preferences.t("稍后", en: "Later", pl: "Później")) { onResolved() }
|
|
.disabled(busy)
|
|
}
|
|
}
|
|
.padding()
|
|
}
|
|
|
|
private func discardLocal() async {
|
|
guard let scope = env.session.dataScope else { return }
|
|
busy = true
|
|
defer { busy = false }
|
|
do {
|
|
let remote = try await env.session.client.getMemo(id: item.memoId, includeDeleted: true)
|
|
_ = try env.outbox.remove(scope: scope, id: item.id, expectedVersion: nil)
|
|
try env.mirror.upsertMemo(scope: scope, memo: remote)
|
|
try env.drafts.clear(scope: scope, key: DraftRepository.memoKey(item.memoId))
|
|
onResolved()
|
|
} catch {
|
|
self.error = error.localizedDescription
|
|
}
|
|
}
|
|
}
|