Home > Projects | Ruby > RailsJa

RailsJa

  • 2009-02-26 (木) 11:25
  • hatena button
  • hatena count
  • save this page del.icio.us

Introduction

インストールするだけで、Ruby on Rails (Rails2.1 以下) を日本語化するプラグインです。

Installation

ruby script/plugin install git://github.com/kusakari/rails-ja.git

Example

モデルの日本語化

モデル名、アトリビュート名は以下のように設定します。

class Message < ActiveRecord::Base
  class << self
    @@humanized_attribute_names = {
      "title" => "タイトル",
      "body" => "本文",
    }
    def human_model_name
      "メッセージ"
    end
  end
end

関連情報

参考

日本語化プラグイン情報

Home > Projects | Ruby > RailsJa

Calendar
« 2010 年 9月 »
M T W T F S S
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
ページ
ブログパーツ

Return to page top