Files
OSGKeyboard/OSGKeyboardTests/PolishStylesL10nTests.swift
Cursor AgentandRocky 5fe07443fe 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>
2026-09-20 23:10:03 +00:00

27 lines
998 B
Swift

// 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")
}
}
}