TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Commercial |
ReleasedLast Release | Feb 2017 |
Maintained by Scott Rossillo, Emilien Huet.
Note: this library is now deprecated. Please use the updated Smartling context capture framework with improved string matching capabilities.
Captures context from a native iOS application and uploads it to Smartling's translation management system. Check out a demo video and see instructions below.
Smartling Context Kit provides the capability to capture native iOS application views for the purpose of providing context for your source content that will be shown in the Smartling Translation Interface. Smartling analyzes uploaded views for context and matches strings in a Smartling project. When Smartling finds a match, the captured views become the visual context that users see in the Smartling Translation Interface. Smartling will not create any new content from the views uploaded to the context matching service, and every unique string in Smartling can have only one context.
If you don't yet have a Smartling account, sign up at Smartling.com.
Create file named Smartling.plist in your main project. The contents should be similar to this:
<?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>enabled</key>
<true/>
<key>apiKey</key>
<string>your-key-here</string>
<key>projectId</key>
<string>your-project-id-here</string>
</dict>
</plist>
Optionally, you can omit enabled
or set it to <false/>
and programatically enable context capture
(described below).
Note: You can find your Project Id and API Key under Project Settings -> API in the Smartling Dashboard.
pod 'SmartlingContextKit', :configurations => ['Debug']
SmartlingContextKit.framework
into your project's Framework's folderIf you require further assistance, please refer to Apple's Guide to Configurating Your Application.
1) Make sure your resource files are uploaded to your Smartling project. See our help center for more detail on managing your resource files in Smartling.
2) Ensure that your ProjectID and APIKey are correctly entered in the Smartling.plist file in your main project
3) Launch your app in a test environment. Click the ‘HI’ button on any screen to capture context for that screen.
4) Smartling will search for matching strings in your Smartling project and use the snapshot you just took to show dynamic context for those strings.
If you're Automating UI Testing, you can capture context programatically from your UI testing script. Use the following code snippet to capture context for each view:
var appWindow = target.frontMostApp().mainWindow();
appWindow.buttons()["Smartling Capture Context"].tap();
Please keep in mind:
.tap()
after showing one of these views..tap()
the context capture button once per view. The button will be removed after being tapped.As of release 0.11.0, you may enable or disable Smartling Context Capturing Library while your application is running using notifications.
Objective-C:
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMContextCaptureEnable" object:self];
Swift:
NSNotificationCenter.defaultCenter().postNotificationName("SMContextCaptureEnable", object: self)
Objective-C:
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMContextCaptureDisable" object:self];
Swift:
NSNotificationCenter.defaultCenter().postNotificationName("SMContextCaptureDisable", object: self)
iOS Context is currently in beta. That means we need your feedback. Please send any issues or suggestions to [email protected]. If context for a particular string is unsatisfactory, please send a screenshot or a dashboard link.