Skip to content

squadracer/locale_ninja

Repository files navigation

Gem Version Ruby on Rails CI

🥷 LocaleNinja

A Git-based gem to manage translations in your Ruby on Rails app.

Demo : https://ninja-local-test.osc-fr1.scalingo.io/

LocaleNinja simplifies the management of translations on a website. Unlike traditional solutions that require connecting to an external platform, LocaleNinja is a Git-based gem installed directly in your project, allowing you to maintain full control over your translations without relying on a third-party service.


✨ Key Features

Streamlined Translation Management: LocaleNinja provides a user-friendly interface to effortlessly handle all your website translations within the same project.

Seamless Git Integration: LocaleNinja connects to your Git repository and automatically handles pull and push of translation files. This ensures smooth collaboration with developers and simplifies the process of updating translations.


💻 Installation

Add this line to your application's Gemfile:

gem "locale_ninja"

And then execute:

$ bundle

Or install it yourself as:

$ gem install locale_ninja

⚙️ Setup

To setup LocalNinja you will need to create a github app in your repository, it will allow your app to commit to your repo. When you are on the github app form, here are some steps specific to our application to follow :

  • In the "Identifying and authorizing users" section, your callback url will be : your-domain-name.com/locale_ninja/github
  • In the "Webhook" section switch off the "active" checkbox
  • In the "Permissions" section, you will have to:
    • Switch "Content" permissions to "Read and write"
    • Switch "Metadata" permissions to "Read-only"
    • Switch "Pull requests" permissions to "Read-only"

Once done you will have access to your client_id and client_secret. You can then run :

bin/rails credentials:edit

And add this, in the editor that just open-up :

github:
    repository_name: organization/repository_name
    client_secret: <40 bytes long secret key>
    client_id: <20 bytes long id>

You can then close the editor, this will generate a master.keyfile and a credentials.yml.enc file in the config folder. Now your connexion with github is totally setup.


You now just have to add this in your routes :

#config/routes.rb
mount LocaleNinja::Engine => '/locale_ninja'

Your translation manager will be accessible at your-domain-name/locale_ninja or localhost:3000/locale_ninja 🎉

👥 Contributors

Julien Marseille
Julien Marseille
Clément Avenel
Clément Avenel
Pierre Fitoussi
Pierre Fitoussi
Théo Dupuis
Théo Dupuis

License

The gem is available as open source under the terms of the MIT License.