h1. Copycopter Client This is the client gem for integrating apps with "Copycopter":http://copycopter.com. The client integrates with the I18n gem so that you can access copy text and translations from a Copycopter project. h2. Installation Just install the gem:
gem install copycopter_client
h3. Rails 3 Add the following line to your Gemfile:
gem "copycopter_client"
Then run bundle install. h3. Rails 2 Add the following line to your config/environment.rb:
config.gem 'copycopter_client'
Then run rake gems:install. We also recommend vendoring the gem by running rake gems:unpack:dependencies GEM=copycopter_client. h2. Configuration Add the following to your application:
CopycopterClient.configure do |config|
  config.api_key = "YOUR API KEY HERE"
end
In a Rails application, this should be saved as config/initializers/copycopter.rb. You can find the API key on the project page on the Copycopter website. See the {CopycopterClient::Configuration} class for a full list of configuration options. h2. Usage You can access blurbs from Copycopter by using I18n.translate. This is also aliased as translate or just t inside Rails controllers and views.
# In a controller
def index
  flash[:success] = t("users.create.success", :default => "User created")
end

# In a view
<%= t(".welcome", :default => "Why hello there") %>

# Global scope (for example, in a Rake task)
I18n.translate("system.tasks_complete", :default => "Tasks complete")

# Interpolation
I18n.translate("mailer.welcome", :default => "Welcome, %{name}!", :name => @user.name)
See the "I18n documentation":http://rdoc.info/github/svenfuchs/i18n/master/file/README.textile documentation for more examples. h2. Deploys Blurbs start out as draft copy, and won't be displayed in production environments until they're published. If you want to publish all draft copy when deploying to production, you can use the copycopter:deploy rake task:
rake copycopter:deploy
h2. About Copyright (c) 2010 "thoughtbot, inc.":http://thoughtbot.com, released under the MIT license