[WIP] Plural Localization for banner-subtitle (IOS-241)

Caveat: doesn't work yet 🤡
This commit is contained in:
Nathan Mattes 2024-07-23 17:37:32 +02:00
parent ffc80268c5
commit 287587fcf1
5 changed files with 1798 additions and 1744 deletions

View File

@ -649,5 +649,21 @@
<string>%lds ago</string>
</dict>
</dict>
<key>plural.filtered_notification_banner.subtitle</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@number_of_requests@</string>
<key>number_of_requests</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>ld</string>
<key>one</key>
<string>One person you may know</string>
<key>other</key>
<string>%ld people you may know</string>
</dict>
</dict>
</dict>
</plist>

View File

@ -649,5 +649,21 @@
<string>%lds ago</string>
</dict>
</dict>
<key>plural.filtered_notification_banner.subtitle</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@number_of_requests@</string>
<key>number_of_requests</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>ld</string>
<key>one</key>
<string>One person you may know</string>
<key>other</key>
<string>%ld people you may know</string>
</dict>
</dict>
</dict>
</plist>

View File

@ -85,6 +85,6 @@ class NotificationFilteringBannerTableViewCell: UITableViewCell {
}
func configure(with policy: Mastodon.Entity.NotificationPolicy) {
subtitleLabel.text = "\(policy.summary.pendingRequestsCount) people you may know"
subtitleLabel.text = L10n.Plural.FilteredNotificationBanner.subtitle(policy.summary.pendingRequestsCount)
}
}

View File

@ -1982,6 +1982,12 @@ public enum L10n {
}
}
}
public enum FilteredNotificationBanner {
/// Plural format key: "%#@number_of_requests@"
public static func subtitle(_ p1: Int) -> String {
return L10n.tr("Localizable", "plural.filtered_notification_banner.subtitle", p1, fallback: "Plural format key: \"%#@number_of_requests@\"")
}
}
}
}
// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length

View File

@ -649,5 +649,21 @@
<string>%lds ago</string>
</dict>
</dict>
<key>plural.filtered_notification_banner.subtitle</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@number_of_requests@</string>
<key>number_of_requests</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>ld</string>
<key>one</key>
<string>One person you may know</string>
<key>other</key>
<string>%ld people you may know</string>
</dict>
</dict>
</dict>
</plist>