Erste Schritte

The LocaleUI-Rails Gem is a Ruby on Rails application gem that provides developers with a seamless way to manage and synchronise translation files with LocaleUI.com. By integrating the Gem into the Rails application, translations can be automatically synchronised, updated and deployed directly to LocaleUI without manually uploading or copying language files.

The LocaleUI-Rails Gem makes the management of multilingual Ruby on Rails applications uncomplicated and automated - ideal for companies that want to offer their Ruby on Rails application in different languages.

Requirements

To use the LocaleUI-Rails Gem, you need a Ruby on Rails application and a valid account on LocaleUI.com. The Gem is compatible with Ruby 3.2+ and higher and Rails 7.1+ and higher.

Installation

Install the gem and add to the application's Gemfile by executing:

      
Command line
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG

If bundler is not being used to manage dependencies, install the gem by executing:

      
Command line
$ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG

Next, you need to create a config file for localeui-rails. Run the following command to copy a basic config file.

      
Command line
rails g localeui:install

Configuration

The configuration file is located in the config/initializers/localeui.rb directory. In this file, you can set the API token, Project ID and other settings for the Gem.

      
Ruby
Localeui.config do |config| # ... # Authentication Token config.api_token = ENV['LOCALEUID_API_TOKEN'] # Project API ID config.project_id = ENV['LOCALEUID_PROJECT_ID'] # ...other options end

Upload translation files

The Gem provides a command to upload translation files to LocaleUI. This command can be run from the command line and automatically uploads all translation files in the project to the specified project on LocaleUI.

The command to upload translation files is:

      
Command line
$ rails localeui:upload

The command can be run from the command line in the root directory of the Rails application. The Gem automatically detects all translation files in the project and uploads them to the specified project on LocaleUI.

Download translation files

The Gem also provides a command to download translation files from LocaleUI. This command can be run from the command line and automatically downloads all translation files from the specified project on LocaleUI to the local project.

The command to download translation files is:

      
Command line
$ rails localeui:download

The command can be run from the command line in the root directory of the Rails application. The Gem automatically detects all translation files in the project and downloads them from the specified project on LocaleUI.