LoginSignup
0
1

More than 1 year has passed since last update.

日本語化 i18n

Posted at

1.はじめに

  • 日本語化対応の手順をメモ

2.日本語化実装

2−1.i18nのプラグインを確認

$ bundle list
  • 一覧を確認してi18n (1.12.0)などの記載があればOK
  • ない場合は、Gemfileに下記を記載
Gemfile
gem 'rails-i18n'

その後

$ bundle install

2−2.config/application.rbに下記を追記

config/application.rb
config.i18n.default_locale = :ja

2−3.翻訳用ファイルをgitHubからダウンロード

ダウンロード後./config/locale/の配下に入れる。

2−4.日本語訳をja.ymlに追加する

./config/locale/ja.yml
ja:
  activerecord:
    attributes:
      user:
        name: '名前'
      post:
        location: '旅行先'
        text: '感想'

3.deviceの日本語化実装

3−1.device翻訳用ファイルをgitHubからダウンロード

devise.ja.yml

ダウンロード後./config/locale/の配下に入れる。

4.おわりに

以上で日本語化の実装ができます

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1