From ea23f480b8d4557a1ab93baf34949cc207479ecc Mon Sep 17 00:00:00 2001 From: Soongyu Kwon Date: Sun, 6 Aug 2023 18:37:47 +0900 Subject: [PATCH] fix: localise widgets' title and description --- ios/OTLWidgets/Localizable.xcstrings | 108 ++++++++++++++++++++++++ ios/OTLWidgets/NextClassWidget.swift | 8 +- ios/OTLWidgets/TodayClassesWidget.swift | 8 +- ios/OTLWidgets/WeekClassesWidget.swift | 6 +- ios/Runner.xcodeproj/project.pbxproj | 5 ++ 5 files changed, 127 insertions(+), 8 deletions(-) create mode 100644 ios/OTLWidgets/Localizable.xcstrings diff --git a/ios/OTLWidgets/Localizable.xcstrings b/ios/OTLWidgets/Localizable.xcstrings new file mode 100644 index 00000000..4d679374 --- /dev/null +++ b/ios/OTLWidgets/Localizable.xcstrings @@ -0,0 +1,108 @@ +{ + "sourceLanguage" : "en", + "strings" : { + "nextclasswidget.description" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Check the lecture to start next." + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "다음에 시작할 수업을 확인합니다." + } + } + } + }, + "nextclasswidget.title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Next Lecture" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "다음 수업" + } + } + } + }, + "todayclasseswidget.description" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Check today's lectures." + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "오늘 수업을 확인합니다." + } + } + } + }, + "todayclasseswidget.title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Today's Lecture" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "오늘 수업" + } + } + } + }, + "weekclasseswidget.description" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Check all lectures for a week" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "일주일의 모든 수업을 확인합니다." + } + } + } + }, + "weekclasseswidget.title" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Weekly Timetable" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "주간 시간표" + } + } + } + } + }, + "version" : "1.0" +} \ No newline at end of file diff --git a/ios/OTLWidgets/NextClassWidget.swift b/ios/OTLWidgets/NextClassWidget.swift index aa2c86fc..54ce5d2f 100644 --- a/ios/OTLWidgets/NextClassWidget.swift +++ b/ios/OTLWidgets/NextClassWidget.swift @@ -246,13 +246,15 @@ struct NextClassWidgetEntryView : View { struct NextClassWidget: Widget { let kind: String = "NextClassWidget" - + private let title: LocalizedStringKey = "nextclasswidget.title" + private let description: LocalizedStringKey = "nextclasswidget.description" + var body: some WidgetConfiguration { IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in NextClassWidgetEntryView(entry: entry) } - .configurationDisplayName("다음 수업") - .description("다음에 시작할 수업을 확인합니다.") + .configurationDisplayName(title) + .description(description) .supportedFamilies([.systemSmall]) } } diff --git a/ios/OTLWidgets/TodayClassesWidget.swift b/ios/OTLWidgets/TodayClassesWidget.swift index aa155f39..1d9850d7 100644 --- a/ios/OTLWidgets/TodayClassesWidget.swift +++ b/ios/OTLWidgets/TodayClassesWidget.swift @@ -188,13 +188,15 @@ struct ExactTimeLine: View { struct TodayClassesWidget: Widget { let kind: String = "TodayClassesWidget" - + private let title: LocalizedStringKey = "todayclasseswidget.title" + private let description: LocalizedStringKey = "todayclasseswidget.description" + var body: some WidgetConfiguration { IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in TodayClassesWidgetEntryView(entry: entry) } - .configurationDisplayName("오늘 수업") - .description("오늘 수업을 확인합니다.") + .configurationDisplayName(title) + .description(description) .supportedFamilies([.systemMedium]) } } diff --git a/ios/OTLWidgets/WeekClassesWidget.swift b/ios/OTLWidgets/WeekClassesWidget.swift index 8a186b8c..b0ec2ac0 100644 --- a/ios/OTLWidgets/WeekClassesWidget.swift +++ b/ios/OTLWidgets/WeekClassesWidget.swift @@ -205,13 +205,15 @@ struct WeekClassesLectureView: View { struct WeekClassesWidget: Widget { let kind: String = "WeekClassesWidget" + private let title: LocalizedStringKey = "weekclasseswidget.title" + private let description: LocalizedStringKey = "weekclasseswidget.description" var body: some WidgetConfiguration { IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in WeekClassesWidgetEntryView(entry: entry) } - .configurationDisplayName("주간 시간표") - .description("일주일의 모든 수업을 확인합니다.") + .configurationDisplayName(title) + .description(description) .supportedFamilies([.systemLarge]) } } diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 0227ad6d..6401dd61 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 2DAD2A5367C379DF7800BE5C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1192CE4F13ED3097A8AFDA65 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 8B04B3A62A7F9A8D001027AF /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 8B04B3A52A7F9A8D001027AF /* Localizable.xcstrings */; }; 8B1EA3B82A0FFF3B00387753 /* WeekClassesWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B1EA3B72A0FFF3B00387753 /* WeekClassesWidget.swift */; }; 8B76C8E42A0E834A007E1947 /* TodayClassesWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B76C8E32A0E834A007E1947 /* TodayClassesWidget.swift */; }; 8B76C8E62A0E837F007E1947 /* WidgetBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B76C8E52A0E837F007E1947 /* WidgetBase.swift */; }; @@ -90,6 +91,7 @@ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 76D656FDF089F15187A13F7D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 8B04B3A52A7F9A8D001027AF /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; 8B1EA3B72A0FFF3B00387753 /* WeekClassesWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeekClassesWidget.swift; sourceTree = ""; }; 8B76C8E32A0E834A007E1947 /* TodayClassesWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayClassesWidget.swift; sourceTree = ""; }; 8B76C8E52A0E837F007E1947 /* WidgetBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetBase.swift; sourceTree = ""; }; @@ -191,6 +193,7 @@ 8BB3DE0729D1F25B001AD191 /* Configuration.intentdefinition */, 8BB3DE0829D1F25B001AD191 /* Assets.xcassets */, 8BB3DE0A29D1F25B001AD191 /* Info.plist */, + 8B04B3A52A7F9A8D001027AF /* Localizable.xcstrings */, ); path = OTLWidgets; sourceTree = ""; @@ -358,6 +361,7 @@ knownRegions = ( en, Base, + ko, ); mainGroup = 97C146E51CF9000F007C117D; productRefGroup = 97C146EF1CF9000F007C117D /* Products */; @@ -384,6 +388,7 @@ buildActionMask = 2147483647; files = ( 8BB3DE0929D1F25B001AD191 /* Assets.xcassets in Resources */, + 8B04B3A62A7F9A8D001027AF /* Localizable.xcstrings in Resources */, 8B949A0729FF4CD0009D4750 /* NotoSansKR-Bold.otf in Resources */, 8B949A1129FF4CDF009D4750 /* NotoSansKR-Medium.otf in Resources */, 8B949A1629FF4CE6009D4750 /* NotoSansKR-Regular.otf in Resources */,