KO
|
EN
gitlite — search
Search
#python
#android
#java
#machine-learning
#typescript
#linux
#game
#docker
#golang
#cpp
#csharp
#rust
Polyglot
★ 106
Open GitHub ↗
A simple Swift API for Microsoft Translator
Download README (.md)
Explore Similar Repositories
dx11
:
C# & SlimDx exploration of Frank Luna's Introduction to 3D Game Programming with DirectX 11
nativescript-imagepicker
:
Imagepicker plugin supporting both single and multiple selection.
cn-cbor
:
A constrained node implementation of CBOR in C
SPRINT_gan
:
Privacy-preserving generative deep neural networks support clinical data sharing
aws-k8s-kops-ansible
:
Kubernetes setup on Amazon AWS using Kops and Ansible
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
Polyglot
?
Download (.md)
Polyglot ======== [](https://travis-ci.org/ayanonagon/Polyglot) Swift wrapper around the Microsoft Translator API. By default, it translates to English from whatever language is detected. ## Installation The easiest way to get started is to use CocoaPods. Just add the following line to your Podfile: ```ruby pod 'Polyglot', '~> 0.5' ``` Otherwise, just include the contents of the `Polyglot` directory manually to your project. ## Basic Usage Create a new ```Polyglot``` instance. ```swift let translator = Polyglot(clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET") ``` You can optionally specify to & from language codes. ```swift translator.fromLanguage = Language.Dutch // It will automatically detect the language if you don't set this. translator.toLanguage = Language.English // English. This is the default. ``` Start translating. ```swift let dutch = "Ik weet het niet." translator.translate(dutch) { translation in print("\"\(dutch)\" means \"\(translation)\"") } ``` Check out the [sample project](https://github.com/ayanonagon/Polyglot/tree/master/PolyglotSample) for a quick demo. ## Supported Languages This list will grow as Microsoft Translator’s list grows. | Supported languages | | ------------------- | | Arabic | | Bosnian | | Bosnian (Latin) | | Bulgarian | | Catalan | | ChineseSimplified | | ChineseTraditional | | Croation | | Czech | | Danish | | Dutch | | English | | Estonian | | Finnish | | French | | German | | Greek | | Haitian Creole | | Hebrew | | Hindi | | HmongDaw | | Hungarian | | Indonesian | | Italian | | Japanese | | Kiswahili | | Klingon | | Klingon pIqaD | | Korean | | Latvian | | Lithuanian | | Malay | | Maltese | | Norwegian | | Persian | | Polish | | Portuguese | | Queretaro Otomi | | Romanian | | Russian | | Serbian | | Serbian (Cyrillic) | | Serbian (Latin) | | Slovak | | Slovenian | | Spanish | | Swedish | | Thai | | Turkish | | Ukrainian | | Urdu | | Vietnamese | | Welsh | | Yucatec Maya | ## Setting up an account for Microsoft Translator 1. Subscribe to the Microsoft Translator service [here](https://datamarket.azure.com/dataset/bing/microsofttranslator). You’ll probably need to set up a new account first. Good luck. :trollface: 2. Create a new application [here](https://datamarket.azure.com/developer/applications). This is where you will be given a client ID and client secret (which you will need for using Polyglot). ## Contributing We’d love to see your ideas for improving this library! The best way to contribute is by submitting a pull request. We’ll do our best to respond to your patch as soon as possible. You can also submit a [new GitHub issue](https://github.com/ayanonagon/Polyglot/issues/new) if you find bugs or have questions. :octocat: Please make sure to follow our general coding style and add test coverage for new features!