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:bootstrap@5.2.3/dist/js/bootstrap.esm.js"
 pin "flatpickr", to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/esm/index.js"
+pin "flatpickr/dist/l10n/fr", to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/fr.js"
 pin "jquery", to: "https://ga.jspm.io/npm:jquery@3.6.3/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