TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2017 |
Maintained by Rekha Manju Kiran.
A simple iOS utility to translate text using Microsoft Azure Cognitive Services
Signup to Azure Cognitive services Follow the steps in this link Azure Cognitive Services and obtain the azure translate key and token
Import the "RMKAzureTranslator.h" file into your App Delegate file
Create a pointer for a String containing the obtained azure Key
Call the "initWithAzureKey" method in didFinishLaunchingWithOptions function with the above created pointer.
#import <RMKAzureTranslator/RMKAzureTranslator.h>
static NSString *const RMKAzureTranslatorKey = <Insert-your-azureKey-here>;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[RMKAzureTranslator initWithAzureKey:RMKAzureTranslatorKey];
return YES;
}
Import the "RMKAzureTranslator.h" file into the ViewController Invoke the "translateString" method Pass the Text to be translated, the Source ISO language code of the source string. -- __Set nil if language unknown , the utility will autodetect_ and the Destination ISO language code of the desired language output.
[[RMKAzureTranslator sharedInstance] translateString:@"Hello, my name is Rekha"
fromLanguage:@"en" toLanguage:@"fr" onCompletion:^(NSString *translatedString, NSError *error)
{
if(error)
{
NSLog(@"%@",error);
}
else
{
NSLog(@"%@",translatedString);
}
}]
Run the app
add the line
pod 'RMKAzureTranslator'
to your podfile
FGTranslator uses the following projects:
RMKAzureTranslator is available under the MIT license. See the LICENSE file for more info.