fix(styles): resolve style captions through in-app language

Style card descriptions were passed to Text as raw String keys, so they
never went through AppL10n. Resolve them (and the editor title) with the
in-app UI language override, matching the rest of the host app.

Co-authored-by: Rocky <hkgood@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-09-20 23:10:03 +00:00
co-authored by Rocky
parent 0023741455
commit 5fe07443fe
4 changed files with 44 additions and 16 deletions
@@ -0,0 +1,26 @@
// PolishStylesL10nTests.swift
// OSGKeyboard · Tests
//
// Style-card captions live in the host Localizable.strings table and must be
// resolved through AppL10n so the in-app language override wins.
@testable import OSGKeyboard
@testable import OSGKeyboardShared
import XCTest
final class PolishStylesL10nTests: XCTestCase {
func testBuiltinStyleCardDescriptionsHonorInAppLanguage() {
let slugs = PolishStylePackCatalog.builtins.map {
String($0.id.dropFirst("builtin.".count))
} + ["custom"]
for slug in slugs {
let key = "polishStyles.\(slug).description"
let english = AppL10n.string(key, language: .english)
let chinese = AppL10n.string(key, language: .chinese)
XCTAssertNotEqual(english, key, "missing English copy for \(key)")
XCTAssertNotEqual(chinese, key, "missing Chinese copy for \(key)")
XCTAssertNotEqual(english, chinese, "\(key) is not bilingual")
}
}
}