Converts widget to localization standards

The widget has been converted to the new Localization standards. Additionally, it has removed the build phase script for SwiftGen.
This commit is contained in:
Stuart Breckenridge
2023-01-08 09:20:19 +08:00
parent 0cfabf23d6
commit b7dbe5c6a5
13 changed files with 196 additions and 242 deletions

View File

@@ -12,10 +12,10 @@
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>ld</string>
<key>other</key>
<string>Copy Article URLs</string>
<key>one</key>
<string>Copy Article URL</string>
<key>other</key>
<string>Copy Article URLs</string>
</dict>
</dict>
</dict>

View File

@@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */
1701E1B52568983D009453D8 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1701E1B72568983D009453D8 /* Localizable.strings */; };
1701E1E725689D1E009453D8 /* Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1701E1E625689D1E009453D8 /* Localized.swift */; };
17071EF026F8137400F5E71D /* ArticleTheme+Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17071EEF26F8137400F5E71D /* ArticleTheme+Notifications.swift */; };
17071EF126F8137400F5E71D /* ArticleTheme+Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17071EEF26F8137400F5E71D /* ArticleTheme+Notifications.swift */; };
1710B9132552354E00679C0D /* AddAccountHelpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1710B9122552354E00679C0D /* AddAccountHelpView.swift */; };
@@ -49,7 +48,6 @@
179D280D26F73D83003B2E0A /* ArticleThemePlist.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179D280C26F73D83003B2E0A /* ArticleThemePlist.swift */; };
179DB1DFBCF9177104B12E0F /* AccountsNewsBlurWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179DBBA2B22A659F81EED6F9 /* AccountsNewsBlurWindowController.swift */; };
179DB3CE822BFCC2D774D9F4 /* AccountsNewsBlurWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 179DBBA2B22A659F81EED6F9 /* AccountsNewsBlurWindowController.swift */; };
17D0682C2564F47E00C0B37E /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 17D0682B2564F47E00C0B37E /* Localizable.stringsdict */; };
17D643B126F8A436008D4C05 /* ArticleThemeDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D643B026F8A436008D4C05 /* ArticleThemeDownloader.swift */; };
17D643B226F8A436008D4C05 /* ArticleThemeDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D643B026F8A436008D4C05 /* ArticleThemeDownloader.swift */; };
17E0084625941887000C23F0 /* SizeCategories.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17E0084525941887000C23F0 /* SizeCategories.swift */; };
@@ -861,6 +859,7 @@
DF790D6228E990A900455FC7 /* AboutData.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF790D6128E990A900455FC7 /* AboutData.swift */; };
DF84E563295122BA0045C334 /* TimelineCustomizerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF84E562295122BA0045C334 /* TimelineCustomizerView.swift */; };
DF93DB2B296A319000586C0E /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DF93DB2D296A319000586C0E /* Localizable.stringsdict */; };
DF93DB2F296A42BD00586C0E /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DF93DB31296A42BD00586C0E /* Localizable.stringsdict */; };
DFB3497A294A962D00BC81AD /* AddAccountListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFB34979294A962D00BC81AD /* AddAccountListView.swift */; };
DFB34980294B085100BC81AD /* AccountInspectorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFB3497F294B085100BC81AD /* AccountInspectorView.swift */; };
DFB34988294B447F00BC81AD /* InjectedNavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFB34987294B447F00BC81AD /* InjectedNavigationView.swift */; };
@@ -1163,7 +1162,6 @@
/* Begin PBXFileReference section */
1701E1B62568983D009453D8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
1701E1E625689D1E009453D8 /* Localized.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Localized.swift; sourceTree = "<group>"; };
17071EEF26F8137400F5E71D /* ArticleTheme+Notifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ArticleTheme+Notifications.swift"; sourceTree = "<group>"; };
1710B9122552354E00679C0D /* AddAccountHelpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddAccountHelpView.swift; sourceTree = "<group>"; };
1710B928255246F900679C0D /* EnableExtensionPointHelpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnableExtensionPointHelpView.swift; sourceTree = "<group>"; };
@@ -1194,7 +1192,6 @@
178A9F9C2549449F00AB7E9D /* AddAccountsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddAccountsView.swift; sourceTree = "<group>"; };
179D280C26F73D83003B2E0A /* ArticleThemePlist.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleThemePlist.swift; sourceTree = "<group>"; };
179DBBA2B22A659F81EED6F9 /* AccountsNewsBlurWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountsNewsBlurWindowController.swift; sourceTree = "<group>"; };
17D0682B2564F47E00C0B37E /* Localizable.stringsdict */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; path = Localizable.stringsdict; sourceTree = "<group>"; };
17D643B026F8A436008D4C05 /* ArticleThemeDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleThemeDownloader.swift; sourceTree = "<group>"; };
17D7586C2679C21700B17787 /* NetNewsWire-iOS-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NetNewsWire-iOS-Bridging-Header.h"; sourceTree = "<group>"; };
17E0084525941887000C23F0 /* SizeCategories.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SizeCategories.swift; sourceTree = "<group>"; };
@@ -1638,6 +1635,9 @@
DF84E562295122BA0045C334 /* TimelineCustomizerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineCustomizerView.swift; sourceTree = "<group>"; };
DF93DB2C296A319000586C0E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
DF93DB2E296A324100586C0E /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "en-GB"; path = "en-GB.lproj/Localizable.stringsdict"; sourceTree = "<group>"; };
DF93DB30296A42BD00586C0E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = "<group>"; };
DF93DB33296A4A8F00586C0E /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = "<group>"; };
DF93DB34296A4A9300586C0E /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "en-GB"; path = "en-GB.lproj/Localizable.stringsdict"; sourceTree = "<group>"; };
DFB34979294A962D00BC81AD /* AddAccountListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddAccountListView.swift; sourceTree = "<group>"; };
DFB3497F294B085100BC81AD /* AccountInspectorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountInspectorView.swift; sourceTree = "<group>"; };
DFB34987294B447F00BC81AD /* InjectedNavigationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InjectedNavigationView.swift; sourceTree = "<group>"; };
@@ -1669,7 +1669,6 @@
DFB616BD29653A0700A359AB /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = "<group>"; };
DFB616BE29653A0700A359AB /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = "<group>"; };
DFB616BF29653A0700A359AB /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = "<group>"; };
DFB616C029653A0700A359AB /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = "<group>"; };
DFBB4EAB2951BC0200639228 /* NNWThemeDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NNWThemeDocument.swift; sourceTree = "<group>"; };
DFBB4EAF2951BCAC00639228 /* ArticleThemeManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleThemeManagerView.swift; sourceTree = "<group>"; };
DFC14F0E28EA55BD00F6EE86 /* AboutWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutWindowController.swift; sourceTree = "<group>"; };
@@ -1885,10 +1884,9 @@
176814792564BE3C00D98635 /* Resources */ = {
isa = PBXGroup;
children = (
1701E1E625689D1E009453D8 /* Localized.swift */,
1768147A2564BE5400D98635 /* widget-sample.json */,
1701E1B72568983D009453D8 /* Localizable.strings */,
17D0682B2564F47E00C0B37E /* Localizable.stringsdict */,
DF93DB31296A42BD00586C0E /* Localizable.stringsdict */,
);
path = Resources;
sourceTree = "<group>";
@@ -3075,7 +3073,6 @@
176813EF2564BB2C00D98635 /* Sources */,
176813F02564BB2C00D98635 /* Frameworks */,
176813F12564BB2C00D98635 /* Resources */,
1701E1BF25689B44009453D8 /* SwiftGen Localization */,
17EF6A1725C4E59D002C9F81 /* Embed Frameworks */,
);
buildRules = (
@@ -3496,7 +3493,7 @@
176813FC2564BB2D00D98635 /* Assets.xcassets in Resources */,
1701E1B52568983D009453D8 /* Localizable.strings in Resources */,
1768147B2564BE5400D98635 /* widget-sample.json in Resources */,
17D0682C2564F47E00C0B37E /* Localizable.stringsdict in Resources */,
DF93DB2F296A42BD00586C0E /* Localizable.stringsdict in Resources */,
DF6DE5282965971A002EC085 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -3737,24 +3734,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
1701E1BF25689B44009453D8 /* SwiftGen Localization */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "SwiftGen Localization";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if ! command -v swiftgen &> /dev/null\nthen\n echo \"swiftgen could not be found\"\n exit\nfi\n\nswiftgen run strings -t structured-swift5 \"$PROJECT_DIR/Widget/Resources/en.lproj/Localizable.strings\" \"$PROJECT_DIR/Widget/Resources/Localizable.stringsdict\" --output \"$PROJECT_DIR/Widget/Resources/Localized.swift\";\n";
};
515D50802326D02600EE1167 /* Run Script: Verify No Build Settings */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
@@ -3939,7 +3918,6 @@
1768146C2564BD8100D98635 /* WidgetDeepLinks.swift in Sources */,
1768143E2564BCC800D98635 /* TodayWidget.swift in Sources */,
1768142D2564BCA800D98635 /* TimelineProvider.swift in Sources */,
1701E1E725689D1E009453D8 /* Localized.swift in Sources */,
176814652564BD7F00D98635 /* WidgetData.swift in Sources */,
1768145E2564BD7B00D98635 /* WidgetDataDecoder.swift in Sources */,
176814132564BC8A00D98635 /* WidgetBundle.swift in Sources */,
@@ -4698,7 +4676,7 @@
isa = PBXVariantGroup;
children = (
1701E1B62568983D009453D8 /* en */,
DFB616C029653A0700A359AB /* en-GB */,
DF93DB33296A4A8F00586C0E /* en-GB */,
);
name = Localizable.strings;
sourceTree = "<group>";
@@ -4925,6 +4903,15 @@
name = Localizable.stringsdict;
sourceTree = "<group>";
};
DF93DB31296A42BD00586C0E /* Localizable.stringsdict */ = {
isa = PBXVariantGroup;
children = (
DF93DB30296A42BD00586C0E /* en */,
DF93DB34296A4A9300586C0E /* en-GB */,
);
name = Localizable.stringsdict;
sourceTree = "<group>";
};
DFB616A72965300400A359AB /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (

View File

@@ -1,86 +0,0 @@
// swiftlint:disable all
// Generated using SwiftGen https://github.com/SwiftGen/SwiftGen
import Foundation
// swiftlint:disable superfluous_disable_command file_length implicit_return
// MARK: - Strings
// swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length
// swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces
internal enum L10n {
/// Plural format key: "%#@localized_count@"
internal static func localizedCount(_ p1: Int) -> String {
return L10n.tr("Localizable", "LocalizedCount", p1)
}
/// Your smart feeds, summarized.
internal static let smartFeedSummaryWidgetDescription = L10n.tr("Localizable", "SmartFeedSummary_Widget_Description")
/// Your Smart Feed Summary
internal static let smartFeedSummaryWidgetTitle = L10n.tr("Localizable", "SmartFeedSummary_Widget_Title")
/// Starred
internal static let starred = L10n.tr("Localizable", "Starred")
/// A sneak peek at your starred articles.
internal static let starredWidgetDescription = L10n.tr("Localizable", "Starred_Widget_Description")
/// When you mark articles as Starred, they'll appear here.
internal static let starredWidgetNoItems = L10n.tr("Localizable", "Starred_Widget_NoItems")
/// Starred
internal static let starredWidgetNoItemsTitle = L10n.tr("Localizable", "Starred_Widget_NoItemsTitle")
/// Your Starred Articles
internal static let starredWidgetTitle = L10n.tr("Localizable", "Starred_Widget_Title")
/// Plural format key: "%#@starred_count@"
internal static func starredCount(_ p1: Int) -> String {
return L10n.tr("Localizable", "StarredCount", p1)
}
/// Today
internal static let today = L10n.tr("Localizable", "Today")
/// A sneak peek at recently published unread articles.
internal static let todayWidgetDescription = L10n.tr("Localizable", "Today_Widget_Description")
/// There are no recent unread articles left to read.
internal static let todayWidgetNoItems = L10n.tr("Localizable", "Today_Widget_NoItems")
/// Today
internal static let todayWidgetNoItemsTitle = L10n.tr("Localizable", "Today_Widget_NoItemsTitle")
/// Your Today Articles
internal static let todayWidgetTitle = L10n.tr("Localizable", "Today_Widget_Title")
/// Plural format key: "%#@today_count@"
internal static func todayCount(_ p1: Int) -> String {
return L10n.tr("Localizable", "TodayCount", p1)
}
/// Unread
internal static let unread = L10n.tr("Localizable", "Unread")
/// A sneak peek at your unread articles.
internal static let unreadWidgetDescription = L10n.tr("Localizable", "Unread_Widget_Description")
/// There are no unread articles left to read.
internal static let unreadWidgetNoItems = L10n.tr("Localizable", "Unread_Widget_NoItems")
/// Unread
internal static let unreadWidgetNoItemsTitle = L10n.tr("Localizable", "Unread_Widget_NoItemsTitle")
/// Your Unread Articles
internal static let unreadWidgetTitle = L10n.tr("Localizable", "Unread_Widget_Title")
/// Plural format key: "%#@unread_count@"
internal static func unreadCount(_ p1: Int) -> String {
return L10n.tr("Localizable", "UnreadCount", p1)
}
}
// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length
// swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces
// MARK: - Implementation Details
extension L10n {
private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
let format = BundleToken.bundle.localizedString(forKey: key, value: nil, table: table)
return String(format: format, locale: Locale.current, arguments: args)
}
}
// swiftlint:disable convenience_type
private final class BundleToken {
static let bundle: Bundle = {
#if SWIFT_PACKAGE
return Bundle.module
#else
return Bundle(for: BundleToken.self)
#endif
}()
}
// swiftlint:enable convenience_type

View File

@@ -1,54 +1,51 @@
/* (No Comment) */
"SmartFeedSummary_Widget_Description" = "Your smart feeds, summarised.";
/* Starred */
"label.text.starred" = "Starred";
/* (No Comment) */
"SmartFeedSummary_Widget_Title" = "Your Smart Feed Summary";
/* (No Comment) */
"Starred" = "Starred";
/* (No Comment) */
"Starred_Widget_Description" = "A sneak peek at your starred articles.";
/* (No Comment) */
"Starred_Widget_NoItems" = "When you mark articles as Starred, they'll appear here.";
/* Starred Widget */
"Starred_Widget_NoItemsTitle" = "Starred";
/* (No Comment) */
"Starred_Widget_Title" = "Your Starred Articles";
/* (No Comment) */
"Today" = "Today ";
/* (No Comment) */
"Today_Widget_Description" = "A sneak peek at recently published unread articles.";
/* (No Comment) */
"Today_Widget_NoItems" = "There are no recent unread articles left to read.";
/* Today Widget */
"Today_Widget_NoItemsTitle" = "Today";
/* (No Comment) */
"Today_Widget_Title" = "Your Today Articles";
/* Today */
"label.text.today" = "Today";
/* Smart Feed Summary Widget */
"Unread" = "Unread";
"label.text.unread" = "Unread";
/* (No Comment) */
"Unread_Widget_Description" = "A sneak peek at your unread articles.";
/* Your smart feeds, summarized. */
"widget.description.smart-feed-summary" = "Your smart feeds, summarised.";
/* (No Comment) */
"Unread_Widget_NoItems" = "There are no unread articles left to read.";
/* A sneak peek at your starred articles. */
"widget.description.starred" = "A sneak peek at your starred articles.";
/* Unread Widget */
"Unread_Widget_NoItemsTitle" = "Unread";
/* When you mark articles as Starred, they'll appear here. */
"widget.description.starred-no-items" = "When you mark articles as Starred, they'll appear here.";
/* A sneak peek at recently published unread articles. */
"widget.description.today" = "A sneak peek at recently published unread articles.";
/* There are no recent unread articles left to read. */
"widget.description.today-no-items" = "There are no recent unread articles left to read.";
/* A sneak peek at your unread articles. */
"widget.description.unread" = "A sneak peek at your unread articles.";
/* There are no unread articles left to read. */
"widget.description.unread-no-items" = "There are no unread articles left to read.";
/* Your Smart Feed Summary */
"widget.title.smart-feed-summary" = "Your Smart Feed Summary";
/* Your Starred Articles */
"widget.title.starred" = "Your Starred Articles";
/* Starred Widget */
"widget.title.starred-no-items" = "Starred";
/* Your Today Articles */
"widget.title.today" = "Your Today Articles";
/* Today Widget */
"widget.title.today-no-items" = "Today";
/* Bundle */
"Unread_Widget_Title" = "Your Unread Articles";
"widget.title.unread" = "Your Unread Articles";
/* No comment provided by engineer. */
"Untitled" = "Untitled";
/* Unread Widget */
"widget.title.unread-no-items" = "Unread";

View File

@@ -2,25 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UnreadCount</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@unread_count@</string>
<key>unread_count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>u</string>
<key>zero</key>
<string>No more unread articles</string>
<key>one</key>
<string>+ 1 more unread article</string>
<key>other</key>
<string>+ %u more unread articles</string>
</dict>
</dict>
<key>StarredCount</key>
<key>starred.count.%lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@starred_count@</string>
@@ -29,47 +11,49 @@
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>u</string>
<key>zero</key>
<string>No more starred articles</string>
<string>lld</string>
<key>one</key>
<string>+ 1 more starred article</string>
<key>other</key>
<string>+ %u more starred articles</string>
<string>+ %lld more starred articles</string>
<key>zero</key>
<string>No more starred articles</string>
</dict>
</dict>
<key>TodayCount</key>
<key>today.count.%lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@today_count@</string>
<key>today_count</key>
<key>today.count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>u</string>
<key>zero</key>
<string>No more recent articles</string>
<string>lld</string>
<key>one</key>
<string>+ 1 more recent unread article</string>
<key>other</key>
<string>+ %u more recent unread articles</string>
<string>+ %lld more recent unread articles</string>
<key>zero</key>
<string>No more recent articles</string>
</dict>
</dict>
<key>LocalizedCount</key>
<key>unread.count.%lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@localized_count@</string>
<key>localized_count</key>
<string>%#@unread_count@</string>
<key>unread_count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>u</string>
<key>zero</key>
<string>0</string>
<string>lld</string>
<key>one</key>
<string>+ 1 more unread article</string>
<key>other</key>
<string>%u</string>
<string>+ %lld more unread articles</string>
<key>zero</key>
<string>No more unread articles</string>
</dict>
</dict>
</dict>

View File

@@ -7,31 +7,31 @@
*/
/* Bundle */
"Unread_Widget_Title" = "Your Unread Articles";
"Unread_Widget_Description" = "A sneak peek at your unread articles.";
"widget.title.unread" = "Your Unread Articles";
"widget.description.unread" = "A sneak peek at your unread articles.";
"Today_Widget_Title" = "Your Today Articles";
"Today_Widget_Description" = "A sneak peek at recently published unread articles.";
"widget.title.today" = "Your Today Articles";
"widget.description.today" = "A sneak peek at recently published unread articles.";
"Starred_Widget_Title" = "Your Starred Articles";
"Starred_Widget_Description" = "A sneak peek at your starred articles.";
"widget.title.starred" = "Your Starred Articles";
"widget.description.starred" = "A sneak peek at your starred articles.";
"SmartFeedSummary_Widget_Title" = "Your Smart Feed Summary";
"SmartFeedSummary_Widget_Description" = "Your smart feeds, summarized.";
"widget.title.smart-feed-summary" = "Your Smart Feed Summary";
"widget.description.smart-feed-summary" = "Your smart feeds, summarized.";
/* Unread Widget */
"Unread_Widget_NoItemsTitle" = "Unread";
"Unread_Widget_NoItems" = "There are no unread articles left to read.";
"widget.title.unread-no-items" = "Unread";
"widget.description.unread-no-items" = "There are no unread articles left to read.";
/* Today Widget */
"Today_Widget_NoItemsTitle" = "Today";
"Today_Widget_NoItems" = "There are no recent unread articles left to read.";
"widget.title.today-no-items" = "Today";
"widget.description.today-no-items" = "There are no recent unread articles left to read.";
/* Starred Widget */
"Starred_Widget_NoItemsTitle" = "Starred";
"Starred_Widget_NoItems" = "When you mark articles as Starred, they'll appear here.";
"widget.title.starred-no-items" = "Starred";
"widget.description.starred-no-items" = "When you mark articles as Starred, they'll appear here.";
/* Smart Feed Summary Widget */
"Unread" = "Unread";
"Today" = "Today ";
"Starred" = "Starred";
"label.text.unread" = "Unread";
"label.text.today" = "Today";
"label.text.starred" = "Starred";

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>unread.count.%lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@unread_count@</string>
<key>unread_count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>zero</key>
<string>No more unread articles</string>
<key>one</key>
<string>+ 1 more unread article</string>
<key>other</key>
<string>+ %lld more unread articles</string>
</dict>
</dict>
<key>starred.count.%lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@starred_count@</string>
<key>starred_count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>zero</key>
<string>No more starred articles</string>
<key>one</key>
<string>+ 1 more starred article</string>
<key>other</key>
<string>+ %lld more starred articles</string>
</dict>
</dict>
<key>today.count.%lld</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@today_count@</string>
<key>today.count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>zero</key>
<string>No more recent articles</string>
<key>one</key>
<string>+ 1 more recent unread article</string>
<key>other</key>
<string>+ %lld more recent unread articles</string>
</dict>
</dict>
</dict>
</plist>

View File

@@ -11,8 +11,6 @@ import RSWeb
struct ArticleItemView: View {
var article: LatestArticle
var deepLink: URL
@State private var iconImage: Image?
@@ -30,7 +28,7 @@ struct ArticleItemView: View {
// Title and Feed Name
VStack(alignment: .leading) {
Text(article.articleTitle ?? "Untitled")
Text(verbatim: article.articleTitle ?? "Untitled")
.font(.footnote)
.bold()
.lineLimit(1)
@@ -38,12 +36,12 @@ struct ArticleItemView: View {
.padding(.top, -3)
HStack {
Text(article.feedTitle)
Text(verbatim: article.feedTitle)
.font(.caption)
.lineLimit(1)
.foregroundColor(.secondary)
Spacer()
Text(pubDate(article.pubDate))
Text(verbatim: pubDate(article.pubDate))
.font(.caption)
.lineLimit(1)
.foregroundColor(.secondary)

View File

@@ -26,7 +26,7 @@ struct SmartFeedSummaryWidgetView: View {
VStack(alignment: .leading, spacing: 2) {
HStack {
todayImage
Text(L10n.today).bold().font(.body)
Text("label.text.today", comment: "Today").bold().font(.body)
Spacer()
Text(formattedCount(entry.widgetData.currentTodayCount)).bold()
@@ -34,14 +34,14 @@ struct SmartFeedSummaryWidgetView: View {
HStack {
unreadImage
Text(L10n.unread).bold().font(.body)
Text("label.text.unread", comment: "Unread").bold().font(.body)
Spacer()
Text(formattedCount(entry.widgetData.currentUnreadCount)).bold()
}
HStack {
starredImage
Text(L10n.starred).bold().font(.body)
Text("label.text.starred", comment: "Starred").bold().font(.body)
Spacer()
Text(formattedCount(entry.widgetData.currentStarredCount)).bold()
}

View File

@@ -37,7 +37,7 @@ struct StarredWidgetView : View {
Spacer()
VStack(alignment:.leading, spacing: 0) {
ForEach(0..<maxCount(), content: { i in
ForEach(0..<maxCount(), id: \.self, content: { i in
if i != 0 {
Divider()
ArticleItemView(article: entry.widgetData.starredArticles[i],
@@ -61,7 +61,7 @@ struct StarredWidgetView : View {
HStack {
Spacer()
if entry.widgetData.currentStarredCount - maxCount() > 0 {
Text(L10n.starredCount(entry.widgetData.currentStarredCount - maxCount()))
Text(String(format: NSLocalizedString("starred.count.%lld", comment: "Number of starred articles beyond what are currently displayed in the widget."), locale: .current, starredCount()))
.font(.caption2)
.bold()
.foregroundColor(.secondary)
@@ -97,6 +97,10 @@ struct StarredWidgetView : View {
return entry.widgetData.currentStarredCount >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.currentStarredCount
}
func starredCount() -> Int {
entry.widgetData.currentStarredCount - maxCount()
}
var inboxZero: some View {
VStack(alignment: .center) {
Spacer()
@@ -107,11 +111,11 @@ struct StarredWidgetView : View {
.foregroundColor(.yellow)
Text(L10n.starredWidgetNoItemsTitle)
Text("widget.title.starred-no-items", comment: "Starred")
.font(.headline)
.foregroundColor(.primary)
Text(L10n.starredWidgetNoItems)
Text("widget.description.starred-no-items", comment: "When you mark articles as Starred, they'll appear here.")
.font(.caption)
.foregroundColor(.gray)
Spacer()

View File

@@ -37,7 +37,7 @@ struct TodayWidgetView : View {
Spacer()
VStack(alignment:.leading, spacing: 0) {
ForEach(0..<maxCount(), content: { i in
ForEach(0..<maxCount(), id: \.self, content: { i in
if i != 0 {
Divider()
ArticleItemView(article: entry.widgetData.todayArticles[i],
@@ -61,10 +61,12 @@ struct TodayWidgetView : View {
HStack {
Spacer()
if entry.widgetData.currentTodayCount - maxCount() > 0 {
Text(L10n.todayCount(entry.widgetData.currentTodayCount - maxCount()))
Text(String(format: NSLocalizedString("today.count.%lld", comment: "Number of today articles beyond what are currently displayed in the widget."), locale: .current, todayCount()))
.font(.caption2)
.bold()
.foregroundColor(.secondary)
}
}
}
@@ -84,6 +86,10 @@ struct TodayWidgetView : View {
.foregroundColor(.orange)
}
func todayCount() -> Int {
entry.widgetData.currentTodayCount - maxCount()
}
func maxCount() -> Int {
var reduceAccessibilityCount: Int = 0
if SizeCategories().isSizeCategoryLarge(category: sizeCategory) {
@@ -106,11 +112,11 @@ struct TodayWidgetView : View {
.foregroundColor(.orange)
Text(L10n.todayWidgetNoItemsTitle)
Text("widget.title.today-no-items", comment: "Today")
.font(.headline)
.foregroundColor(.primary)
Text(L10n.todayWidgetNoItems)
Text("widget.description.today-no-items", comment: "There are no recent unread articles left to read.")
.font(.caption)
.foregroundColor(.gray)
Spacer()

View File

@@ -37,7 +37,7 @@ struct UnreadWidgetView : View {
Spacer()
VStack(alignment:.leading, spacing: 0) {
ForEach(0..<maxCount(), content: { i in
ForEach(0..<maxCount(), id: \.self, content: { i in
if i != 0 {
Divider()
ArticleItemView(article: entry.widgetData.unreadArticles[i],
@@ -61,7 +61,7 @@ struct UnreadWidgetView : View {
HStack {
Spacer()
if entry.widgetData.currentUnreadCount - maxCount() > 0 {
Text(L10n.unreadCount(entry.widgetData.currentUnreadCount - maxCount()))
Text(String(format: NSLocalizedString("unread.count.%lld", comment: "Number of unread articles beyond what are currently displayed in the widget."), locale: .current, unreadCount()))
.font(.caption2)
.bold()
.foregroundColor(.secondary)
@@ -95,6 +95,10 @@ struct UnreadWidgetView : View {
return entry.widgetData.unreadArticles.count >= 3 ? (3 - reduceAccessibilityCount) : entry.widgetData.unreadArticles.count
}
func unreadCount() -> Int {
entry.widgetData.currentUnreadCount - maxCount()
}
var inboxZero: some View {
VStack(alignment: .center) {
Spacer()
@@ -104,11 +108,11 @@ struct UnreadWidgetView : View {
.foregroundColor(.accentColor)
.frame(width: 30)
Text(L10n.unreadWidgetNoItemsTitle)
Text("widget.title.unread-no-items", comment: "Unread")
.font(.headline)
.foregroundColor(.primary)
Text(L10n.unreadWidgetNoItems)
Text("widget.description.unread-no-items", comment: "There are no unread articles left to read.")
.font(.caption)
.foregroundColor(.gray)
Spacer()

View File

@@ -22,8 +22,8 @@ struct UnreadWidget: Widget {
.background(Color("WidgetBackground"))
})
.configurationDisplayName(L10n.unreadWidgetTitle)
.description(L10n.unreadWidgetDescription)
.configurationDisplayName(Text("widget.title.unread", comment: "Your Unread Articles"))
.description(Text("widget.description.unread", comment: "A sneak peek at your unread articles."))
.supportedFamilies([.systemMedium, .systemLarge])
}
@@ -40,8 +40,8 @@ struct TodayWidget: Widget {
.background(Color("WidgetBackground"))
})
.configurationDisplayName(L10n.todayWidgetTitle)
.description(L10n.todayWidgetDescription)
.configurationDisplayName(Text("widget.title.today", comment: "Your Today Articles"))
.description(Text("widget.description.today", comment: "A sneak peek at recently published unread articles."))
.supportedFamilies([.systemMedium, .systemLarge])
}
@@ -58,8 +58,8 @@ struct StarredWidget: Widget {
.background(Color("WidgetBackground"))
})
.configurationDisplayName(L10n.starredWidgetTitle)
.description(L10n.starredWidgetDescription)
.configurationDisplayName(Text("widget.title.starred", comment: "Your Starred Articles"))
.description(Text("widget.description.starred", comment: "A sneak peek at your starred articles."))
.supportedFamilies([.systemMedium, .systemLarge])
}
@@ -75,8 +75,8 @@ struct SmartFeedSummaryWidget: Widget {
return StaticConfiguration(kind: kind, provider: Provider(), content: { entry in
SmartFeedSummaryWidgetView(entry: entry)
})
.configurationDisplayName(L10n.smartFeedSummaryWidgetTitle)
.description(L10n.smartFeedSummaryWidgetDescription)
.configurationDisplayName(Text("widget.title.smart-feed-summary", comment: "Your Smart Feed Summary"))
.description(Text("widget.description.smart-feed-summary", comment: "Your smart feeds, summarized."))
.supportedFamilies([.accessoryRectangular])
}
}