Using copycopter only for development environment and standard I18n translations files inside your application. Limit copycopter client only for development environment, edit whatever you want to edit through your copycopter application, download all cached blurbs to a yml file (copycopter.yml
), split it and push all the generated yml files to your production application.
- This method is intended for applications that don't need to be upgrading languages too often.
Forget latency between your application and copycopter application.
Updating translations require to push to your application environment all translations files.
Put your copycopter_client
gem on development group
#/Gemfile
group :development do
gem 'copycopter_client', '~> 2.0.1'
end
Limit Copycopter initialization to development environment
#/config/initializers/copycopter.rb
if Rails.env.development?
CopycopterClient.configure do |config|
config.api_key = 'YOUR_API_KEY'
config.host = 'YOUR_HOST'
end
end
Paste ccopter.rake
in your tasks directory
lib/tasks/ccopter.rake
If you have your copycopter application up and with all blurbs working fine and published (rake copycopter:deploy
) for your application on development environment, proceed with the process described below.
-
Export all cached blurbs to a yml file (
config/locales/copycopter.yml
)rake copycopter:export
-
Split downloaded file in as many ymls as languages you have on your application
rake ccopter:split_ccopter_file
-
Push all generated files to your production application and done, now you have your application running with out copycopter client, and taking all translations from your language files on
config/locales
If you have any problem just delete all translations files and return to your previous configuration.
rake ccopter:delete_lang_files --trace
Obtaining advantages of copycopter managing translations while using standard Rails I18n configuration on production application.
No latency between production application and copycopter application for blurbs downloading, there's no communication with copycopter application, all blurbs remains inside production application.
Of course, this is intended for applications that don't need to be upgrading languages too often.