AppLocale.dev is an app that helps you manage your Ruby on Rails translations.
Used 30 times
A
Andrea Fomera
Usage
Sign up for an account at https://applocale.dev
Check out the gem: https://github.com/applocale/applocale-ruby
Check out the gem: https://github.com/applocale/applocale-ruby
Run this command in your Rails app directory in the terminal:
rails app:template LOCATION="https://railsbytes.com/script/X8Bsjj"
Template Source
Review the code before running this template on your machine.
run "spring stop"
puts "đ Welcome to AppLocale's installation process"
puts ""
puts "âšī¸ You'll need to open up https://applocale.dev in your browser."
puts " - Login"
puts " - Click the avatar and open the dropdown"
puts " - Click API Tokens"
puts " - Create a new API Token"
puts " "
puts "âšī¸ If you don't yet have a project, make sure you create one and setup your languages first!"
puts ""
puts "đ Okay next up we'll ask for the API Token, and Project ID which you can find on the API Tokens page."
puts ""
api_token = ask("What is your AppLocale API Token?")
project_id = ask("What is your Project ID?")
puts ""
puts "đ Great! Thanks for that. We'll go ahead and install the applocale-ruby gem in the development group."
run "bundle add applocale-ruby -g development"
puts ""
puts ""
puts "â
Installed applocale-ruby"
puts "⨠Now we're going to generate your configuration file. We're putting it inside of config/applocale.yml"
config_file = <<-CONFIG
# AppLocale.dev configuration file
applocale:
api_key: #{api_token}
project_id: #{project_id}
CONFIG
create_file "config/applocale.yml", config_file
puts ""
puts ""
puts "â
Generated config/applocale.yml"
puts "đ You did it! The configuration is setup and you're all set for using the gem"
puts ""
puts " - Pull your translations down with 'bundle exec applocale pull'"
puts " "
puts "See usage instructions: https://github.com/applocale/applocale-ruby"