Use stringsdict for favorites/reblogs count

This commit is contained in:
Shadowfacts 2021-11-25 12:37:49 -05:00
parent 2b22180191
commit eca7f31e82
2 changed files with 36 additions and 3 deletions

View File

@ -67,9 +67,10 @@ class ConversationMainStatusTableViewCell: BaseStatusTableViewCell {
override func updateStatusState(status: StatusMO) {
super.updateStatusState(status: status)
// todo: localize me
totalFavoritesButton.setTitle("\(status.favouritesCount) Favorite\(status.favouritesCount == 1 ? "" : "s")", for: .normal)
totalReblogsButton.setTitle("\(status.reblogsCount) Reblog\(status.reblogsCount == 1 ? "" : "s")", for: .normal)
let favoritesFormat = NSLocalizedString("favorites count", comment: "conv main status favorites button label")
totalFavoritesButton.setTitle(String.localizedStringWithFormat(favoritesFormat, status.favouritesCount), for: .normal)
let reblogsFormat = NSLocalizedString("reblogs count", comment: "conv main status reblogs button label")
totalReblogsButton.setTitle(String.localizedStringWithFormat(reblogsFormat, status.reblogsCount), for: .normal)
}
override func updateUI(account: AccountMO) {

View File

@ -61,5 +61,37 @@
<string>%u replies</string>
</dict>
</dict>
<key>favorites count</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@favorites@</string>
<key>favorites</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>u</string>
<key>one</key>
<string>1 favorite</string>
<key>other</key>
<string>%u favorites</string>
</dict>
</dict>
<key>reblogs count</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@reblogs@</string>
<key>reblogs</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>u</string>
<key>one</key>
<string>1 reblog</string>
<key>other</key>
<string>%u reblogs</string>
</dict>
</dict>
</dict>
</plist>