Latest 1.0.1
Homepage https://github.com/RekhaManjukiran/RMKAzureTranslator
License MIT
Platforms osx , ios , tvos , watchos , requires ARC
Authors

A simple iOS utility to translate text using Microsoft Azure Cognitive Services

Steps to integrate

Step1

Signup to Azure Cognitive services
Follow the steps in this link Azure Cognitive Services and obtain the azure translate key and token

Step 2

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;
}

Step 3

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);
         }
     }]

Step 4

Run the app

Demo

  1. Go to the RMKAzureTranslatorDemo directory.
  2. Open RMKAzureTranslatorDemo.xcodeproj
  3. Run the app.

Adding RMKAzureTranslator to Your Project

add the line

pod 'RMKAzureTranslator' 

to your podfile

CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like RMKAzureTranslator in your projects. See the "Getting Started" guide for more information.

Attributions

RMKAzureTranslator uses the following projects:

License

RMKAzureTranslator is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "RMKAzureTranslator",
    "version": "1.0.1",
    "license": "MIT",
    "summary": "A simple iOS utility to translate using Microsoft Azure",
    "homepage": "https://github.com/RekhaManjukiran/RMKAzureTranslator",
    "authors": {
        "Rekha Manju Kiran": "[email protected]"
    },
    "source": {
        "git": "https://github.com/RekhaManjukiran/RMKAzureTranslator.git",
        "tag": "v1.0.1"
    },
    "source_files": [
        "RMKAzureTranslator",
        "RMKAzureTranslator/XMLDictionary"
    ],
    "requires_arc": true,
    "platforms": {
        "osx": null,
        "ios": null,
        "tvos": null,
        "watchos": null
    }
}

Pin It on Pinterest

Share This