Skip to content
Mitsuhiro Shibuya edited this page Dec 24, 2022 · 65 revisions

Rails

Pick your locale here

Devise

See https://github.com/plataformatec/devise/wiki/I18n and https://github.com/tigrish/devise-i18n

RailsAdmin

Copy https://github.com/sferik/rails_admin/blob/master/config/locales/rails_admin.en.yml to your config/locales directory and adapt it to your needs.

Flatpickr

For Webpack/Webpacker setup

You need to manually import Flatpickr locales you want to use:

app/javascript/packs/rails_admin.js or app/javascript/rails_admin.js

  import "rails_admin/src/rails_admin/base";
  import "../stylesheets/rails_admin.scss";
+ import "flatpickr/dist/l10n/fr"; // individually
+ import "flatpickr/dist/l10n/index"; // or all at once

For Importmap setup

In addition to 'Webpack/Webpacker setup' above, you also need to adjust config/importmap.rails_admin.rb so the browser can pick up the Flatpickr locale correctly.

 pin "bootstrap", to: "https://ga.jspm.io/npm:[email protected]/dist/js/bootstrap.esm.js"
 pin "flatpickr", to: "https://ga.jspm.io/npm:[email protected]/dist/esm/index.js"
+pin "flatpickr/dist/l10n/fr", to: "https://ga.jspm.io/npm:[email protected]/dist/l10n/fr.js"
 pin "jquery", to: "https://ga.jspm.io/npm:[email protected]/dist/jquery.js"

For Asset pipeline setup

All supported locales are loaded by default, just changing locale value is enough.

Translation Missing?

You can pick your locales or contribute in translation here: https://www.localeapp.com/projects/905

Make sure your existing locales do not have admin: key under :en, :es, :de etc. You will get translation missing warning then

Community sourced translations:

You can find old included translations here:

https://github.com/sferik/rails_admin/tree/df631d6d4ed49a5417d8135000611c37f6a3ed9b/config/locales

Clone this wiki locally