golive / phraseapp-ruby

API Client to access PhraseApp API written in Ruby

Home Page:https://phraseapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

phraseapp-ruby

phraseapp-ruby is a Ruby gem that allows you to interact with the PhraseApp API.

PhraseApp is a translation management platform for software projects. You can collaborate on language file translation with your team or order translations through our platform. The API allows you to import locale files, download locale files, tag keys or interact in other ways with the localization data stored in PhraseApp for your account.

phraseapp-ruby is not a replacement for the phrase gem, it is a pure API client for programmaticly using our features inside your own applications and does not support the push or pull commands for locale files. However, it does support uploading and downloading of single locale files through the according API endpoints.

If you're looking for a CLI sync command for PhraseApp, please user our official PhraseApp client. The phrase gem is deprecated and will be discontinued at the end of 2015.

Installation

Install the gem:

gem install phraseapp-ruby

or add it to your Gemfile when using bundler:

gem 'phraseapp-ruby'

and install it via

bundle install

Usage

Setup an Access Token in your PhraseApp user profile for Authentication.

# Require the gem
require 'phraseapp-ruby'

# Setup Authentication Credentials and Client
credentials = PhraseApp::Auth::Credentials.new(token: "YOUR_ACCESS_TOKEN")
client = PhraseApp::Client.new(credentials)

# List projects page 1 and list 10 projects per_page
rsp, err = client.projects_list(1, 10)
puts rsp

# Create a new key
params = PhraseApp::RequestParams::TranslationKeyParams.new(name: "foo")
rsp, err = client.key_create('YOUR_PROJECT_ID', params)
puts rsp

There are also other ways of authentication, which are described in our API v2 Documentation

Documentation

For a full list of available client actions, see the phraseapp-ruby Documentation

The actions are generated automatically from our API specification, so once you get the hang of the Ruby specific naming, you should be able to infer names of actions and endpoints through our API v2 Documentation

OpenSSL

Please note that OpenSSL may cause issues, especially on MacOS X. The following error patterns might be seen:

  • certificate verification failed: On MacOS X this might be caused by rvm binary releases trying to fiddle with root certificates. Using rvm install ruby-2.2.3 --disable-binary fixes the issue. If you already had installed the rvm binaries it might be necessary to reinstall openssl and removing artifacts (like /etc/openssl and /usr/local/etc/openssl).
  • handshake failure: This is most probably related to an outdated version of OpenSSL that tries to initiate a connection using SSLv2/v3 which is not supported by our servers. Updating OpenSSL to version 1.0.2d or later should be sufficient.

Contributing

This library is auto-generated from templates that run against a API specification file. Therefore we can not accept any pull requests in this repository. Please use the GitHub Issue Tracker to report bugs.

Further reading

About

API Client to access PhraseApp API written in Ruby

https://phraseapp.com

License:MIT License


Languages

Language:Ruby 100.0%