Giter VIP home page Giter VIP logo

copycopter-ruby-client's Introduction

Copycopter Client

Build Status

This is the Ruby on Rails client for Copycopter.

It uses I18n to access copy and translations from a Copycopter project.

Installation

In your Gemfile:

gem 'copycopter_client'

Run:

bundle install

In your config/initializers/copycopter.rb:

CopycopterClient.configure do |config|
  config.api_key = 'YOUR API KEY HERE'
  config.host = 'your-copycopter-server.herokuapp.com'
end

The API key is on the project page. See CopycopterClient::Configuration for all configuration options.

Usage

Access blurbs by using I18n.translate. It is aliased as translate and t inside Rails controllers and views.

# controller
def index
  flash[:success] = t('users.create.success', :default => 'User created')
end

# view
<%= t '.welcome', :default => 'Why hello there' %>

# model, rake task, etc.
I18n.translate 'system.tasks_complete', :default => 'Tasks complete'

# Interpolation
I18n.translate 'mailer.welcome', :default => 'Welcome, %{name}!',
  :name => @user.name

Using a prefixed dot (ex: '.welcome') only works in views. Use the full key in controllers and other places.

I18n docs.

Deploys

Blurbs start out as draft copy and aren't displayed in production until published. To publish all draft copy when deploying, use the rake task:

rake copycopter:deploy

Exporting

Blurbs are cached in-memory while your Rails application is running. To export all cached blurbs to a yml file for offline access, use the rake task:

rake copycopter:export

The exported yaml will be located at config/locales/copycopter.yml.

Contributing

See the style guide.

Credits

thoughtbot

Copycopter Client was created by thoughtbot, inc

It is maintained by the fine folks at Crowdtap and Iora Health.

License

Copycopter Client is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.

copycopter-ruby-client's People

Contributors

chrishunt avatar dn avatar halogenandtoast avatar jferris avatar joshuaclayton avatar mike-burns avatar mjankowski avatar patricksrobertson avatar tristandunn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.