From 49307a316fe7f96ca65c701f0c2efa9724f6b0e9 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Tue, 28 Mar 2023 23:05:47 +0200 Subject: [PATCH] Add localization (IOS-37) --- Localization/app.json | 6 ++++++ .../Sources/MastodonLocalization/Generated/Strings.swift | 8 ++++++++ .../Resources/Base.lproj/Localizable.strings | 2 ++ .../Resources/en.lproj/Localizable.strings | 2 ++ WidgetExtension/Variants/Hashtag/HashtagWidget.swift | 6 +++--- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Localization/app.json b/Localization/app.json index 5e63124f9..36275e994 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -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." + } } } } diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index e1c6db802..fb0b497c3 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -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.") diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings index 9be911ddb..6f7d0c8f4 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/Base.lproj/Localizable.strings @@ -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"; diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings index 9be911ddb..6f7d0c8f4 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings @@ -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"; diff --git a/WidgetExtension/Variants/Hashtag/HashtagWidget.swift b/WidgetExtension/Variants/Hashtag/HashtagWidget.swift index c7ccfd49a..7d5b5218f 100644 --- a/WidgetExtension/Variants/Hashtag/HashtagWidget.swift +++ b/WidgetExtension/Variants/Hashtag/HashtagWidget.swift @@ -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) } }