Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Siri intent definition localisation #214

Merged
merged 10 commits into from
Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- checkout
- run:
name: Save Xcode version
command: xcodebuild -version > .circle-xcode-version
command: xcodebuild -version | tee .circle-xcode-version
- run:
name: Pre-fetch CocoaPods specs
command: |
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0
2.5.0
2 changes: 1 addition & 1 deletion Sources/Tropos/Controllers/TRWeatherController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ - (instancetype)init
if (error != nil) {
os_log_error(OS_LOG_DEFAULT, "Failed to donate interaction: %{public}@", error);
} else {
os_log(OS_LOG_DEFAULT, "Successfully donated check weather interaction!");
os_log_info(OS_LOG_DEFAULT, "Successfully donated check weather interaction.");
}
}];
}
Expand Down
5 changes: 2 additions & 3 deletions Sources/Tropos/Extensions/INInteraction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ extension INInteraction {
return INInteraction(intent: intent, response: nil)
}

private static let checkWeatherSuggestedPhrase = NSLocalizedString(
"Check the weather",
comment: "Siri suggestion phrase to check weather")
private static let checkWeatherSuggestedPhrase = NSString
.deferredLocalizedIntentsString(with: "CheckWeatherSuggestedPhrase") as String
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new concept of deferred localisation enables a donated intent to be localised potentially much later, when the device could have changed language.

}
4 changes: 4 additions & 0 deletions Sources/Tropos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
</dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>Tropos does not access your photo library.</string>
<key>NSUserActivityTypes</key>
<array>
<string>CheckWeatherIntent</string>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was automatically added by Xcode.

</array>
<key>UIAppFonts</key>
<array>
<string>DINNextLTPro-Light.otf</string>
Expand Down
3 changes: 2 additions & 1 deletion Sources/Tropos/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"CheckWeatherSuggestedPhrase" = "Check the weather";
"CheckingWeather" = "Checking Weather...";
"UpdateFailed" = "Update Failed";
"UpdateFailed" = "Update Failed";
1 change: 1 addition & 0 deletions Sources/Tropos/Resources/it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"CheckWeatherSuggestedPhrase" = "Controlla previsioni Meteo";
"CheckingWeather" = "Controllo il Meteo...";
"UpdateFailed" = "Update non riuscito";
1 change: 1 addition & 0 deletions Sources/Tropos/Resources/pl-PL.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"CheckWeatherSuggestedPhrase" = "Sprawdź pogodę";
"CheckingWeather" = "Sprawdzam pogodę...";
"UpdateFailed" = "Brak połączenia z serwerem";
1 change: 1 addition & 0 deletions Sources/Tropos/Resources/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"CheckWeatherSuggestedPhrase" = "Kontrollera vädret";
"CheckingWeather" = "Uppdaterar prognos...";
"UpdateFailed" = "Uppdatering misslyckades";
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<key>INIntentDefinitionModelVersion</key>
<string>1.0</string>
<key>INIntentDefinitionSystemVersion</key>
<string>17F77</string>
<string>17G65</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>10L176w</string>
<string>10L232m</string>
<key>INIntentDefinitionToolsVersion</key>
<string>10.0</string>
<key>INIntents</key>
Expand Down
5 changes: 5 additions & 0 deletions Sources/TroposIntents/it.lproj/Intents.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"8SKsHj" = "Controlla previsioni meteo";

"Hpkcrr" = "${conditionsDescription}";

"RwwC7B" = "Controlla le attuali previsioni meteo";
5 changes: 5 additions & 0 deletions Sources/TroposIntents/pl-PL.lproj/Intents.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"8SKsHj" = "Sprawdź prognozę pogody";

"Hpkcrr" = "${conditionsDescription}";

"RwwC7B" = "Sprawdź aktualną prognozę pogody";
5 changes: 5 additions & 0 deletions Sources/TroposIntents/sv.lproj/Intents.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"8SKsHj" = "Kontrollera väderprognosen";

"Hpkcrr" = "${conditionsDescription}";

"RwwC7B" = "Kontrollera aktuell väderprognos";
43 changes: 33 additions & 10 deletions Tropos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
4A5FA311212EFC6A00CC313C /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BB9CA2040C33000835531 /* Result.framework */; };
4A5FA312212EFCD100CC313C /* CheckWeatherIntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ABCA2C420CAD14C00C46C4C /* CheckWeatherIntentHandler.swift */; };
4A61FEAF1CF881A200B259E5 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4A552F801CC7D118008C7298 /* Localizable.strings */; };
4A628AB42134514000F455F8 /* Intents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 4ABCA2BF20CAD06100C46C4C /* Intents.intentdefinition */; };
4A69873F1CC80414002D3F87 /* SettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A69873E1CC80414002D3F87 /* SettingsController.swift */; };
4A6987411CC80471002D3F87 /* TroposCore.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A6987401CC80471002D3F87 /* TroposCore.m */; };
4A6987431CC804FE002D3F87 /* UnitSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A6987421CC804FE002D3F87 /* UnitSystem.swift */; };
Expand Down Expand Up @@ -95,9 +94,11 @@
4A95A151212DE48E00E0B33A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A95A150212DE48E00E0B33A /* Foundation.framework */; };
4AA138D9213494970083B816 /* TroposCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A552EEF1CC7C8F8008C7298 /* TroposCore.framework */; };
4AA138DA213494B20083B816 /* ReactiveObjC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A6BB9C82040C33000835531 /* ReactiveObjC.framework */; };
4AA138C021347AAA0083B816 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4AA138C221347AAA0083B816 /* Main.storyboard */; };
4AA138C42134835A0083B816 /* Intents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 4AA138C72134835A0083B816 /* Intents.intentdefinition */; };
4AA138C52134835A0083B816 /* Intents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 4AA138C72134835A0083B816 /* Intents.intentdefinition */; };
4AB9C18A1CC8286F006CBC24 /* New York.placemark in Resources */ = {isa = PBXBuildFile; fileRef = 4A552F771CC7D063008C7298 /* New York.placemark */; };
4ABCA2C320CAD0B300C46C4C /* TroposCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A552EEF1CC7C8F8008C7298 /* TroposCore.framework */; };
4ABCA2C920CB188400C46C4C /* Intents.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 4ABCA2BF20CAD06100C46C4C /* Intents.intentdefinition */; settings = {ATTRIBUTES = (codegen, ); }; };
4AC287A41CBC3D800064F48A /* Nimble.framework in Embed Carthage Frameworks */ = {isa = PBXBuildFile; fileRef = 6D0F135A1B432976001685BA /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4AC287A51CBC3D820064F48A /* Quick.framework in Embed Carthage Frameworks */ = {isa = PBXBuildFile; fileRef = 6D0F135B1B432976001685BA /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4ACA584B1CC526D600DD0CDC /* RACSignal+TROperators.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ACA584A1CC526D600DD0CDC /* RACSignal+TROperators.m */; };
Expand Down Expand Up @@ -143,7 +144,6 @@
C2E44CFB1A3B76B3009CC844 /* NSNumber+TRRoundedNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = C2E44CFA1A3B76B3009CC844 /* NSNumber+TRRoundedNumber.m */; };
CE5D7F3B45F980082E1BCA30 /* LaunchScreen.xib in Sources */ = {isa = PBXBuildFile; fileRef = B6D58F8AA6976EA1B35682B7 /* LaunchScreen.xib */; };
CFC0721C2D9EFFD3C3AE11A7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 059D0BDDF8DCE56549A4C9C6 /* Images.xcassets */; };
E74CDAD61BB614D700F57C1D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E59B090E67C8BD269D3CD9DB /* Main.storyboard */; };
E7A895541AFD11AA0023205B /* TRApplicationController.m in Sources */ = {isa = PBXBuildFile; fileRef = E7A895531AFD11AA0023205B /* TRApplicationController.m */; };
E7B3B9271B34EDFE00BDD5A4 /* TRApplicationControllerSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = E7B3B9261B34EDFE00BDD5A4 /* TRApplicationControllerSpec.m */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -317,7 +317,11 @@
4A86FB64205C0E4D00E761C3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4A95A143212DDFF900E0B33A /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
4A95A150212DE48E00E0B33A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
4ABCA2BF20CAD06100C46C4C /* Intents.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = Intents.intentdefinition; sourceTree = "<group>"; };
4AA138C321347AB80083B816 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4AA138C62134835A0083B816 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; name = Base; path = Base.lproj/Intents.intentdefinition; sourceTree = "<group>"; };
4AA138D421348E350083B816 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Intents.strings; sourceTree = "<group>"; };
4AA138D621348E360083B816 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Intents.strings; sourceTree = "<group>"; };
4AA138D821348E360083B816 /* pl-PL */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pl-PL"; path = "pl-PL.lproj/Intents.strings"; sourceTree = "<group>"; };
4ABCA2C420CAD14C00C46C4C /* CheckWeatherIntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckWeatherIntentHandler.swift; sourceTree = "<group>"; };
4ABCA2CC20CB1F5500C46C4C /* TroposIntents.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TroposIntents.entitlements; sourceTree = "<group>"; };
4ABCA775205C497A009DF765 /* TroposTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TroposTests-Bridging-Header.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -394,7 +398,6 @@
C2E44CFA1A3B76B3009CC844 /* NSNumber+TRRoundedNumber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNumber+TRRoundedNumber.m"; sourceTree = "<group>"; };
D281611EA8A7B26EFB4FBBAC /* libPods-Tropos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tropos.a"; sourceTree = BUILT_PRODUCTS_DIR; };
D4B3B3DB12D62EC9A8EC8411 /* Pods-Tropos-metadata.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "Pods-Tropos-metadata.plist"; path = "Pods/Pods-Tropos-metadata.plist"; sourceTree = "<group>"; };
E59B090E67C8BD269D3CD9DB /* Main.storyboard */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
E7A895521AFD11AA0023205B /* TRApplicationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TRApplicationController.h; sourceTree = "<group>"; };
E7A895531AFD11AA0023205B /* TRApplicationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TRApplicationController.m; sourceTree = "<group>"; };
E7B3B9261B34EDFE00BDD5A4 /* TRApplicationControllerSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TRApplicationControllerSpec.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -581,7 +584,7 @@
isa = PBXGroup;
children = (
4A21D76920C9E6FB0055A2AF /* Info.plist */,
4ABCA2BF20CAD06100C46C4C /* Intents.intentdefinition */,
4AA138C72134835A0083B816 /* Intents.intentdefinition */,
4ABCA2C420CAD14C00C46C4C /* CheckWeatherIntentHandler.swift */,
4A21D76720C9E6FA0055A2AF /* IntentHandler.swift */,
4A5FA309212E052C00CC313C /* TroposIntents-Bridging-Header.h */,
Expand Down Expand Up @@ -838,7 +841,7 @@
7786B6CD5802E36505CA8896 /* Storyboards */ = {
isa = PBXGroup;
children = (
E59B090E67C8BD269D3CD9DB /* Main.storyboard */,
4AA138C221347AAA0083B816 /* Main.storyboard */,
);
path = Storyboards;
sourceTree = "<group>";
Expand Down Expand Up @@ -1137,6 +1140,7 @@
it,
sv,
"pl-PL",
Base,
);
mainGroup = D02B1FEF37316A9F6B8E4B34;
productRefGroup = 702F42EA5C215DCFAE2AAC5C /* Products */;
Expand Down Expand Up @@ -1165,7 +1169,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E74CDAD61BB614D700F57C1D /* Main.storyboard in Resources */,
4AA138C021347AAA0083B816 /* Main.storyboard in Resources */,
4D0A5C3D1A3A53DD0084C41E /* CWForecastDetailView.xib in Resources */,
CFC0721C2D9EFFD3C3AE11A7 /* Images.xcassets in Resources */,
C2E44CE91A3A42C6009CC844 /* InfoPlist.strings in Resources */,
Expand Down Expand Up @@ -1420,7 +1424,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4ABCA2C920CB188400C46C4C /* Intents.intentdefinition in Sources */,
4AA138C52134835A0083B816 /* Intents.intentdefinition in Sources */,
4A21D76820C9E6FA0055A2AF /* IntentHandler.swift in Sources */,
4A5FA312212EFCD100CC313C /* CheckWeatherIntentHandler.swift in Sources */,
);
Expand Down Expand Up @@ -1494,7 +1498,7 @@
files = (
4D49554F1A8C29C30066F278 /* TRCircularProgressLayer.m in Sources */,
4D7389DF1A9890CD0039F13B /* UIScrollView+TRReactiveCocoa.m in Sources */,
4A628AB42134514000F455F8 /* Intents.intentdefinition in Sources */,
4AA138C42134835A0083B816 /* Intents.intentdefinition in Sources */,
4DC069CD1A95B8F800F3BCEB /* TRColorBackdropLayer.m in Sources */,
A10108F91D3369EB0024B1BA /* NSBundle+TRBundleInfo.m in Sources */,
4A8163941CC830A400279952 /* TRSettingsController+TRObservation.m in Sources */,
Expand Down Expand Up @@ -1574,6 +1578,25 @@
name = Localizable.strings;
sourceTree = "<group>";
};
4AA138C221347AAA0083B816 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
4AA138C321347AB80083B816 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
4AA138C72134835A0083B816 /* Intents.intentdefinition */ = {
isa = PBXVariantGroup;
children = (
4AA138C62134835A0083B816 /* Base */,
4AA138D421348E350083B816 /* it */,
4AA138D621348E360083B816 /* sv */,
4AA138D821348E360083B816 /* pl-PL */,
);
name = Intents.intentdefinition;
sourceTree = "<group>";
};
C2E44CE61A3A4273009CC844 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
Expand Down