TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Nov 2015 |
SPMSupports SPM | ✗ |
Maintained by Ayaka Nonaka.
Swift wrapper around the Microsoft Translator API. By default, it translates to English from whatever language is detected.
The easiest way to get started is to use CocoaPods. Just add the following line to your Podfile:
pod 'Polyglot', '~> 0.3'
Otherwise, just include the contents of the Polyglot
directory manually to your project.
Create a new Polyglot
instance.
let translator = Polyglot(clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET")
You can optionally specify to & from language codes.
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.
let dutch = "Ik weet het niet."
translator.translate(dutch) { translation in
println("\"\(dutch)\" means \"\(translation)\"")
}
Check out the sample project for a quick demo.
This list will grow as Microsoft Translator’s list grows.
Supported languages |
---|
Arabic |
Bulgarian |
Catalan |
Chinese (Simplified) |
Chinese (Traditional) |
Czech |
Danish |
Dutch |
English |
Estonian |
Finnish |
French |
German |
Greek |
Haitian Creole |
Hebrew |
Hindi |
Hmong Daw |
Hungarian |
Indonesian |
Italian |
Japanese |
Klingon |
Klingon pIqaD |
Korean |
Latvian |
Lithuanian |
Malay |
Maltese |
Norwegian |
Persian |
Polish |
Portuguese |
Romanian |
Russian |
Slovak |
Slovenian |
Spanish |
Swedish |
Thai |
Turkish |
Ukrainian |
Urdu |
Vietnamese |
Welsh |
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 if you find bugs or have questions.
Please make sure to follow our general coding style and add test coverage for new features!