All Projects → MicrosoftTranslator → Local Feature Android

MicrosoftTranslator / Local Feature Android

Add online and offline text translation to Android apps

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Local Feature Android

Extract.autodesk.io
A sample showing how to extract viewables from the Autodesk OSS storage to your local machine
Stars: ✭ 97 (+61.67%)
Mutual labels:  translation, offline
Mue
Fast, open and free-to-use new tab page for modern browsers
Stars: ✭ 56 (-6.67%)
Mutual labels:  translation
Bartycrouch
Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
Stars: ✭ 1,032 (+1620%)
Mutual labels:  translation
Ioslocalizationeditor
Simple macOS editor app to help you manage iOS and macOS app localizations by allowing you to edit all the translations side by side
Stars: ✭ 1,066 (+1676.67%)
Mutual labels:  translation
Laravel Translatable
It's a Laravel database translations manager
Stars: ✭ 47 (-21.67%)
Mutual labels:  translation
Dash Docset Builder
Dash Docset Builder in PHP.
Stars: ✭ 54 (-10%)
Mutual labels:  offline
Serina
GUI for create translation files for i18next
Stars: ✭ 45 (-25%)
Mutual labels:  translation
Prestashop
Free PWA & SPA for PrestaShop
Stars: ✭ 59 (-1.67%)
Mutual labels:  offline
Zing
Translation server for continuous localization.
Stars: ✭ 55 (-8.33%)
Mutual labels:  translation
Navi
Open Source Project for Grow with Google Udacity Scholarship Challenge - Navigation app using offline first strategy and google maps api - To get started please refer to the README.md - CONTRIBUTING.md and the project Wiki
Stars: ✭ 51 (-15%)
Mutual labels:  offline
Gobyexample
🎁 Go By Example 한국어 버전
Stars: ✭ 50 (-16.67%)
Mutual labels:  translation
Pomodoro
A simple WordPress translation cache
Stars: ✭ 47 (-21.67%)
Mutual labels:  translation
Apollo Cache Persist
🎏 Simple persistence for all Apollo Cache implementations
Stars: ✭ 1,078 (+1696.67%)
Mutual labels:  offline
Pwa Module
Zero config PWA solution for Nuxt.js
Stars: ✭ 1,033 (+1621.67%)
Mutual labels:  offline
Atom I18n
:atom: One Atom i18n Package for Any Locale 🌏 🌎 🌍
Stars: ✭ 56 (-6.67%)
Mutual labels:  translation
Subtitletranslate
Translate the subtitle file into other language
Stars: ✭ 45 (-25%)
Mutual labels:  translation
Eyevis
Android based Vocal Vision for Visually Impaired. Object Detection, Voice Assistance, Optical Character Reader, Read Aloud, Face Recognition, Landmark Recognition, Image Labelling etc.
Stars: ✭ 48 (-20%)
Mutual labels:  translation
Web Archives
A web archives reader
Stars: ✭ 52 (-13.33%)
Mutual labels:  offline
Scp zh
恒星共识协议中文翻译
Stars: ✭ 59 (-1.67%)
Mutual labels:  translation
Emacs Document
translate emacs documents to Chinese for convenient reference
Stars: ✭ 1,085 (+1708.33%)
Mutual labels:  translation

Local feature for the Translator app on Android [Preview]

Local Feature

Translator Local Feature works on the most recent version of the Microsoft Translator Android App. It allows developers to add translation capabilities to their apps utilizing the Translator app already installed on a user device. If the user has language packs downloaded, the translations may also be done offline.

Note: The Local feature is in Preview mode. Please do not use it for any production purposes.

Get Started

How to get started with the Microsoft Translator local feature:

  1. Sign up for a subscription to the Microsoft Translator text API. Select the free 2 million character per month tier, or paid tiers for higher volumes. Learn more.
  2. Use the documentation below and the sample app to learn how to add online and offline translation to your Android app.
  3. Start coding!
  4. Question? Post them to our support forum

Release notes

View release notes here

Usage

The following methods are available with the local feature:

  • Start and stop the service
  • Get a list of supported Languages
  • Perform a text translation from language A to language B
  • Initialize offline engines (for better performance when offline translations are used more than once)

The translatorlocal library included in this repository contains the necessary classes to use the Local Feature. There is also a sample app in the app folder.

com.microsoft.translator.local.Translator is the main class for interfacing with the feature.

  1. Sign up for your API key at the link above in the Get Started section

  2. Check that the Translator app is installed by calling init() it should return Translator.ERROR_NONE if a version of the app that supports the feature is installed.

  3. Start the service by calling start() and check for Translator.ERROR_NONE. If another value is returned, the Translator app may not have been installed on the user device, or may not support the Local Feature.

  4. Check that the service is connected with isConnected()

  5. Use getLanguageList to get a list of languages to translate from and to. The code field corresponds to the language codes you will need for translate. These are language codes like en for English, and es for Spanish. If the user has the offline language pack downloaded for a certain language, the isOnDevice flag will be true. You can use the nativeName to get the language in its native text, or name to get the name in the devices current locale. ( A cached list of languages will be used if the user is offline. )

  6. Perform a translation with the translate method. providing your API key, a category (leave blank for now), the language codes for the from and to languages, and a list of Strings to translate.

The getLanguageList and translate methods are synchronous and may take some time to perform, so they should be done on a background thread.

Here is a simple call flow to perform a translation:

// check if Translator is available

int result = Translator.init(context);
if (result != Translator.ERROR_NONE) {
    // Translator isn't installed or version is unsupported
    return;
}

// set your api key
String API_KEY = "";

// start the service
Translator.start(context, null);

// you may need to delay before isConnected returns true

if (Translator.isConnected()) {
    // get the list of available languages
    LanguageListResult languageResult = Translator.getLanguageList();

    if (!languageResult.isError()) {
        ArrayList<String> texts = new ArrayList<>();
        texts.add("Hello World!");
        
        // perform a translation
        TextTranslationResult textResult = Translator.translate(API_KEY, null, "en", languageResult.getLanguages().get(0).code, texts);
    
        if (!textResult.isError()) {
            System.out.println("Got result: " + textResult.getData().get(0));
        } else {
            System.out.println("Got error: " + textResult.errorMessage);
        }
    }
}

//stop the service when you are finished using it.
Translator.stop();

FAQ

What languages does the local feature support?

For online translation, the local feature supports all Microsoft Translator text translation languages. For offline translation, the local feature will support any language that has available downloadable language packs for Android. The user will need to download the language pack prior to translation. View language lists

For a complete list of Microsoft Translator language codes, refer to the Translator Text API documentation.

Does the local feature use neural machine translation (NMT) or statistical machine translation (SMT)?

The local feature uses NMT by default. If NMT is not available for a particular language, the feature will use the SMT system. View supported NMT languages in the Translator Text API documentation.

Sample App

There is a sample app provided in the app folder of this repository to play around with the API.

You will need to provide your own API key at final String API_KEY = ""; in MainActivity.java

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].