A micro framework for integrating with the Google Translate api

Overview

GoogleTranslateSwift

About

This is a micro library for integrating with the Google Cloud Translation API.

I currently only use it for personal projects, but will document the api so that it is easy to use for anyone.

If it gets more than 100 stars, I'll improve documentation, add a logo, setup a demo app etc.

Getting Started

First, setup a Google Translate account at cloud.google.com.

You can follow this guide to setup a billing account and a Cloud Translation service.

When your account is setup, you can create a GoogleTranslateApiService with your API key:

let service = GoogleTranslateApiService(apiKey: "...")

You can now fetch available languages, detect the language of a text and translate a text from one locale to another:

// Get all supported languages
service.getSupportedLanguages { result in
    ...
}

// Detect the language in a certain string
service.detectLanguage(in: "Hello, world!") { result in
    ...
}

// Translate a string from one locale to another
let english = Locale(identifier: "en")
let swedish = Locale(identifier: "sv")
service.translate(in: "Hello, world!", from: english, to: swedish) { result in
    ...
}

The completions can fail with an SwiftKit.ApiError, which contains information about the request.

Installation

Swift Package Manager

https://github.com/danielsaidi/GoogleTranslateSwift.git

CocoaPods

I will add CocoaPods support after this library gets 100+ stars.

Documentation

I will add documentation to this library after it gets 100+ stars.

Demo Application

I will add CocoaPods support after this library gets 100+ stars.

Contact

Feel free to reach out if you have questions or if you want to contribute in any way:

License

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

You might also like...
 yikyak-translate-ios - iOS Take Home Project
yikyak-translate-ios - iOS Take Home Project

yikyak-translate-ios - iOS Take Home Project Before you start Make sure you have the latest stable version of Xcode and have a way to connect to a Git

Google Analytics tracker for Apple tvOS provides an easy integration of Google Analytics’ measurement protocol for Apple TV.

Google Analytics tracker for Apple tvOS by Adswerve About Google Analytics tracker for Apple tvOS provides an easy integration of Google Analytics’ me

A micro UIStackView convenience API inspired by SwiftUI
A micro UIStackView convenience API inspired by SwiftUI

Stacks A micro UIStackView convenience API inspired by SwiftUI. let stack: UIView = .hStack(alignment: .center, margins: .all(16), [ .vStack(spaci

Butterfly is a lightweight library for integrating bug-report and feedback features with shake-motion event.
Butterfly is a lightweight library for integrating bug-report and feedback features with shake-motion event.

Butterfly is a lightweight library for integrating bug-report and feedback features with shake-motion event. Goals of this project One of th

GenericLocalPersistence is a clean and easy-to-use code that is useful for integrating local storage

GenericLocalPersistence is a clean and easy-to-use code that is useful for integrating local storage like UserDefaults, PList, Keychain.

A react native interface for integrating payments using Braintree

A react native interface for integrating payments using Braintree

Swordinator is a simple way of integrating an iOS Coordinator pattern.
Swordinator is a simple way of integrating an iOS Coordinator pattern.

Swordinator is a minimal, lightweight and easy customizable navigation framework for iOS applications. Requirements iOS 14.0+, Swift 5.0+ Installation

A camera designed in Swift for easily integrating CoreML models - as well as image streaming, QR/Barcode detection, and many other features
A camera designed in Swift for easily integrating CoreML models - as well as image streaming, QR/Barcode detection, and many other features

Would you like to use a fully-functional camera in an iOS application in seconds? Would you like to do CoreML image recognition in just a few more sec

Unopinionated and flexible library for easily integrating Tumblr data into your iOS or OS X application.

Tumblr SDK for iOS An unopinionated and flexible library for easily integrating Tumblr data into your iOS or OS X application. The library uses ARC re

Sample way of integrating animations into a design system for iOS app projects.

Animations in Design System The project presents a sample way of integrating animations into a design system for iOS developers. Project setup A sampl

Nextflix - Integrating project of the IOS development course by Digital House

nextflix Projeto integrador do curso de desenvolvimento IOS pela Digital House A

A micro-framework that leverages Swift Property Wrappers to implement the Service Locator pattern

Locatable Context Locatable is a Swift micro framework that leverages Property Wrappers to implement the Service Locator pattern, through a custom att

A micro-framework for observing file changes, both local and remote. Helpful in building developer tools.
A micro-framework for observing file changes, both local and remote. Helpful in building developer tools.

KZFileWatchers Wouldn't it be great if we could adjust feeds and configurations of our native apps without having to sit back to Xcode, change code, r

A Swift micro-framework to easily deal with weak references to self inside closures

WeakableSelf Context Closures are one of Swift must-have features, and Swift developers are aware of how tricky they can be when they capture the refe

A Swift micro-framework to easily deal with weak references to self inside closures

WeakableSelf Context Closures are one of Swift must-have features, and Swift developers are aware of how tricky they can be when they capture the refe

Aftermath is a stateless message-driven micro-framework in Swift
Aftermath is a stateless message-driven micro-framework in Swift

Aftermath is a stateless message-driven micro-framework in Swift, which is based on the concept of the unidirectional data flow architecture.

DaisyChain is a micro framework which makes UIView animations chaining dead simple.

DaisyChain DaisyChain is a micro framework which makes UIView animations chaining dead simple. It uses the exact same interface you are familiars with

A micro-framework that leverages Swift Property Wrappers to implement the Service Locator pattern

Locatable Context Locatable is a Swift micro framework that leverages Property Wrappers to implement the Service Locator pattern, through a custom att

A micro-library for creating and observing events.

Signals Signals is a library for creating and observing events. It replaces delegates, actions and NSNotificationCenter with something much more power

Owner
Daniel Saidi
Freelance software engineer, focusing on mobile products and Apple platforms like iOS, tvOS and watchOS.
Daniel Saidi
A CLI tool for localization resource management on Xcode. Built with Google Translator.

Supported by Jetbrains Open Source License Program Automatically translate and synchronize '.strings' files from the defined base language The basic c

gitmerge 164 May 4, 2022
Localize is a framework writed in swift to localize your projects easier improves i18n, including storyboards and strings.

Localize Localize is a framework written in swift to help you localize and pluralize your projects. It supports both storyboards and strings. Features

Andres Silva 279 Dec 24, 2022
Localize iOS apps in a smarter way using JSON files. Swift framework.

Swifternalization Swift library that helps in localizing apps in a different, better, simpler, more powerful way than system localization does. It use

Tomasz Szulc 575 Nov 3, 2022
Google-Blogger-iOS-App - Using Google Blogger API to build an iOS app like Medium

Google Blogger iOS App Using Google Blogger API to build an iOS app like Medium!

Ricky Chuang 9 Dec 13, 2022
Approov Integration Examples 0 Jan 26, 2022
Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.

Installation • Configuration • Usage • Build Script • Donation • Migration Guides • Issues • Contributing • License BartyCrouch BartyCrouch incrementa

Flinesoft 1.3k Jan 1, 2023
Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Sparrow Code 31 Jan 3, 2023
This app can translate the MainMenu.xib automatically

Main Menu Translator This app can translate the MainMenu.xib automatically. Desc

Megabits_mzq 17 May 28, 2022
Tutorials from sparrowcode.io website. You can add new, translate or fix typos.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Sparrow Code 31 Jan 3, 2023
Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Страницы доступны на sparrowcode.io/en & sparrowcode.io/ru Как добавить свое приложение Добавьте элемент в json /ru/apps/apps.json. Если ваше приложен

Sparrow Code 30 Nov 25, 2022