chore(Widget): Implement L10n for mock account

This commit is contained in:
Marcus Kida 2023-02-06 19:57:33 +01:00
parent c00e797996
commit 998ed3b307
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
4 changed files with 19 additions and 2 deletions

View File

@ -826,6 +826,12 @@
"title": "FOLLOWERS",
"followers_today": "%s followers today"
},
"multiple_followers": {
"mock_user": {
"display_name": "Another follower",
"account_name": "another@follower.social"
}
},
"latest_followers": {
"title": "Latest followers",
"last_update": "Last update: %s"

View File

@ -1502,6 +1502,14 @@ public enum L10n {
/// Latest followers
public static let title = L10n.tr("Localizable", "Widget.LatestFollowers.Title", fallback: "Latest followers")
}
public enum MultipleFollowers {
public enum MockUser {
/// another@follower.social
public static let accountName = L10n.tr("Localizable", "Widget.MultipleFollowers.MockUser.AccountName", fallback: "another@follower.social")
/// Another follower
public static let displayName = L10n.tr("Localizable", "Widget.MultipleFollowers.MockUser.DisplayName", fallback: "Another follower")
}
}
}
public enum A11y {
public enum Plural {

View File

@ -522,5 +522,7 @@ You cant go wrong with any of our recommend servers, so regardless of which o
"Widget.Common.UserNotLoggedIn" = "Please open Mastodon to log in to an Account.";
"Widget.FollowersCount.Title" = "FOLLOWERS";
"Widget.FollowersCount.FollowersToday" = "%@ followers today";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";
"Widget.MultipleFollowers.MockUser.AccountName" = "another@follower.social";
"Widget.LatestFollowers.Title" = "Latest followers";
"Widget.LatestFollowers.LastUpdate" = "Last update: %@";

View File

@ -4,6 +4,7 @@ import WidgetKit
import SwiftUI
import Intents
import MastodonSDK
import MastodonLocalization
struct MultiFollowersCountWidgetProvider: IntentTimelineProvider {
func placeholder(in context: Context) -> MultiFollowersCountEntry {
@ -116,8 +117,8 @@ private extension MultiFollowersCountWidgetProvider {
accounts.append(
MultiFollowersEntryAccount(
followersCount: 1_200,
displayNameWithFallback: "Another follower",
acct: "@another@follower.social",
displayNameWithFallback: L10n.Widget.MultipleFollowers.MockUser.displayName,
acct: L10n.Widget.MultipleFollowers.MockUser.accountName,
avatarImage: UIImage(named: "missingAvatar")!,
domain: authBox.domain
)