LoginSignup
0
0

More than 1 year has passed since last update.

日本語化の設定

Posted at

Gem”kaminari”の導入をした際に日本語表記設定したのにされておらず、設定の方法を忘れてしまっていた為備忘として残します。

手順
1.日本語設定
2.日本語訳してくれるgem”rails-i18n”のインストール
3.日本語にしたい文字を追記するファイルを作成

1.日本語設定

config/application.rb
# 日本語の言語設定を追記
    config.i18n.default_locale = :ja

2.Gemインストール

Gemfile
gem 'rails-i18n'

追記後 bundle installrails s を忘れずに!

3.ファイルを作成し、文字を追記

※今回はkaminariの設定となります。

config/lacales/ja.yml
ja:
  views:
      pagination:
        first: '最初'
        last: '最後'
        previous: '前'
        next: '次'
        truncate: '...'
0
0
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
0