Add localization (IOS-37)

This commit is contained in:
Nathan Mattes 2023-03-28 23:05:47 +02:00
parent 48a14bc63c
commit 49307a316f
5 changed files with 21 additions and 3 deletions

View File

@ -870,6 +870,12 @@
"configuration_description": "Show latest followers.",
"title": "Latest followers",
"last_update": "Last update: %s"
},
"hashtag": {
"configuration": {
"display_name": "Hashtag",
"description": "Shows a recent status with the selected hashtag."
}
}
}
}

View File

@ -1543,6 +1543,14 @@ public enum L10n {
/// FOLLOWERS
public static let title = L10n.tr("Localizable", "Widget.FollowersCount.Title", fallback: "FOLLOWERS")
}
public enum Hashtag {
public enum Configuration {
/// Shows a recent status with the selected hashtag
public static let description = L10n.tr("Localizable", "Widget.Hashtag.Configuration.Description", fallback: "Shows a recent status with the selected hashtag")
/// Hashtag
public static let displayName = L10n.tr("Localizable", "Widget.Hashtag.Configuration.DisplayName", fallback: "Hashtag")
}
}
public enum LatestFollowers {
/// Show latest followers.
public static let configurationDescription = L10n.tr("Localizable", "Widget.LatestFollowers.ConfigurationDescription", fallback: "Show latest followers.")

View File

@ -543,3 +543,5 @@ uploaded to Mastodon.";
"Widget.MultipleFollowers.ConfigurationDisplayName" = "Multiple followers";
"Widget.MultipleFollowers.MockUser.AccountName" = "another@follower.social";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";
"Widget.Hashtag.Configuration.Description" = "Shows a recent status with the selected hashtag";
"Widget.Hashtag.Configuration.DisplayName" = "Hashtag";

View File

@ -543,3 +543,5 @@ uploaded to Mastodon.";
"Widget.MultipleFollowers.ConfigurationDisplayName" = "Multiple followers";
"Widget.MultipleFollowers.MockUser.AccountName" = "another@follower.social";
"Widget.MultipleFollowers.MockUser.DisplayName" = "Another follower";
"Widget.Hashtag.Configuration.Description" = "Shows a recent status with the selected hashtag";
"Widget.Hashtag.Configuration.DisplayName" = "Hashtag";

View File

@ -3,6 +3,7 @@
import WidgetKit
import SwiftUI
import MastodonSDK
import MastodonLocalization
struct HashtagWidgetProvider: IntentTimelineProvider {
func placeholder(in context: Context) -> HashtagWidgetTimelineEntry {
@ -145,9 +146,8 @@ struct HashtagWidget: Widget {
IntentConfiguration(kind: "Hashtag", intent: HashtagIntent.self, provider: HashtagWidgetProvider()) { entry in
HashtagWidgetView(entry: entry)
}
//TODO: @zeitschlag Add Localization
.configurationDisplayName("Hashtag")
.description("Show a Hashtag")
.configurationDisplayName(L10n.Widget.Hashtag.Configuration.displayName)
.description(L10n.Widget.Hashtag.Configuration.description)
.supportedFamilies(availableFamilies)
}
}