Support double-length pseudlanguage in fallback translations and update snapshots for en-us.

This commit is contained in:
Stefan Ceriu 2025-01-15 14:31:48 +02:00 committed by Stefan Ceriu
parent 0bcc59ae0a
commit c29175d1f9
32 changed files with 67 additions and 59 deletions

View File

@ -2798,7 +2798,11 @@ extension L10n {
guard let bundle = Bundle.lprojBundle(for: language) else { return nil } guard let bundle = Bundle.lprojBundle(for: language) else { return nil }
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "") let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
let translation = String(format: format, locale: Locale(identifier: language), arguments: args) let translation = String(format: format, locale: Locale(identifier: language), arguments: args)
guard translation != key else { return nil } guard translation != key,
translation != "\(key) \(key)" // Handle double pseudo for tests
else {
return nil
}
return translation return translation
} }
} }

View File

@ -162,7 +162,7 @@ struct SessionVerificationScreen: View {
VStack(spacing: 16.0) { VStack(spacing: 16.0) {
Text(emoji.symbol) Text(emoji.symbol)
.font(.compound.headingXLBold) .font(.compound.headingXLBold)
Text(emoji.localizedDescription) Text(emoji.localizedDescription.capitalized)
.font(.compound.bodyMD) .font(.compound.bodyMD)
.foregroundColor(.compound.textSecondary) .foregroundColor(.compound.textSecondary)
} }

View File

@ -90,7 +90,11 @@ extension {{enumName}} {
guard let bundle = Bundle.lprojBundle(for: language) else { return nil } guard let bundle = Bundle.lprojBundle(for: language) else { return nil }
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "") let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
let translation = String(format: format, locale: Locale(identifier: language), arguments: args) let translation = String(format: format, locale: Locale(identifier: language), arguments: args)
guard translation != key else { return nil } guard translation != key,
translation != "\(key) \(key)" // Handle double pseudo for tests
else {
return nil
}
return translation return translation
} }
} }