{"id":13716185,"url":"https://github.com/maximbilan/SwiftGoogleTranslate","last_synced_at":"2025-05-07T05:32:17.456Z","repository":{"id":56922281,"uuid":"155102764","full_name":"maximbilan/SwiftGoogleTranslate","owner":"maximbilan","description":"Lightweight framework for using Cloud Translation API by Google","archived":false,"fork":false,"pushed_at":"2023-07-20T20:59:17.000Z","size":41,"stargazers_count":100,"open_issues_count":1,"forks_count":20,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T07:10:31.924Z","etag":null,"topics":["google","google-cloud-platform","swift","translate","translation","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximbilan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-10-28T18:33:55.000Z","updated_at":"2024-11-08T16:17:24.000Z","dependencies_parsed_at":"2024-01-05T23:42:15.491Z","dependency_job_id":"23833733-9070-4adf-aba6-8e67f527fc75","html_url":"https://github.com/maximbilan/SwiftGoogleTranslate","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"7812b4dcb57e095224ae5e9dbf4f178f9296b147"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2FSwiftGoogleTranslate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2FSwiftGoogleTranslate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2FSwiftGoogleTranslate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2FSwiftGoogleTranslate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximbilan","download_url":"https://codeload.github.com/maximbilan/SwiftGoogleTranslate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823138,"owners_count":21809700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google","google-cloud-platform","swift","translate","translation","xcode"],"created_at":"2024-08-03T00:01:07.865Z","updated_at":"2025-05-07T05:32:17.112Z","avatar_url":"https://github.com/maximbilan.png","language":"Swift","funding_links":[],"categories":["Tools","📦 Libraries"],"sub_categories":["Machine translation for developers","Swift (iOS \u0026 macOS)"],"readme":"## SwiftGoogleTranslate\n\n[![Version](https://img.shields.io/cocoapods/v/SwiftGoogleTranslate.svg?style=flat)](http://cocoadocs.org/docsets/SwiftGoogleTranslate)\n[![License](https://img.shields.io/cocoapods/l/SwiftGoogleTranslate.svg?style=flat)](http://cocoadocs.org/docsets/SwiftGoogleTranslate)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftGoogleTranslate.svg?style=flat)](http://cocoadocs.org/docsets/SwiftGoogleTranslate)\n[![CocoaPods](https://img.shields.io/cocoapods/dt/SwiftGoogleTranslate.svg)](https://cocoapods.org/pods/SwiftGoogleTranslate)\n\nA framework to use \u003ca href=\"https://cloud.google.com/translate/docs/reference/rest\"\u003eCloud Translation API by Google\u003c/a\u003e in Swift.\n:snowman::frog::penguin::whale::turtle:\n\n## Installation\n\u003cb\u003eCocoaPods:\u003c/b\u003e\n\u003cpre\u003e\npod 'SwiftGoogleTranslate'\n\u003c/pre\u003e\n\u003cb\u003eCarthage:\u003c/b\u003e\n\u003cpre\u003e\ngithub \"maximbilan/SwiftGoogleTranslate\"\n\u003c/pre\u003e\n\u003cb\u003eSwift Package Manager:\u003c/b\u003e\n\u003cpre\u003e\ndependencies: [\n    .package(url: \"https://github.com/maximbilan/SwiftGoogleTranslate\", from: \"0.2.2\"))\n]\n\u003c/pre\u003e\n\u003cb\u003eManual:\u003c/b\u003e\n\u003cpre\u003e\nCopy \u003ci\u003eSwiftGoogleTranslate.swift\u003c/i\u003e to your project.\n\u003c/pre\u003e\n\n## Initialization\n\nFirst of all you have to generate API key to use Google Cloud services in the \u003ca href=\"https://cloud.google.com/translate/\"\u003econsole\u003c/a\u003e.\nAnd then use the following code:\n```swift\nSwiftGoogleTranslate.shared.start(with: \"API_KEY_HERE\")\n```\n\n## Using\n\nThe framework supports 3 endpoinds: \u003ci\u003etranslate\u003c/i\u003e, \u003ci\u003edetect\u003c/i\u003e, \u003ci\u003elanguages\u003c/i\u003e. You can find more information in the official source. How to use from the framework.\n\nTranslation:\n```swift\nSwiftGoogleTranslate.shared.translate(\"Hello!\", \"es\", \"en\") { (text, error) in\n  if let t = text {\n    print(t)\n  }\n}\n```\n\nDetection:\n```swift\nSwiftGoogleTranslate.shared.detect(\"¡Hola!\") { (detections, error) in\n  if let detections = detections {\n    for detection in detections {\n      print(detection.language)\n      print(detection.isReliable)\n      print(detection.confidence)\n      print(\"---\")\n    }\n  }\n}\n```\n\nA list of languages:\n```swift\nSwiftGoogleTranslate.shared.languages { (languages, error) in\n  if let languages = languages {\n    for language in languages {\n      print(language.language)\n      print(language.name)\n      print(\"---\")\n    }\n  }\n}\n```\n\n## License\n\n\u003ci\u003eSwiftGoogleTranslate\u003c/i\u003e is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximbilan%2FSwiftGoogleTranslate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximbilan%2FSwiftGoogleTranslate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximbilan%2FSwiftGoogleTranslate/lists"}