Sha256: cecadc75d51b91129190b79477ed47476b0dd633b20c415453e163a6a9d2f662

Contents?: true

Size: 1.54 KB

Versions: 4

Compression:

Stored size: 1.54 KB

Contents

# application.rb - a sample script for Ruby on Rails
# 
# Copyright (C) 2005-2008 Masao Mutoh
#
# This file is distributed under the same license as Ruby-GetText-Package.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time

  # See ActionController::RequestForgeryProtection for details
  # Uncomment the :secret if you're not using the cookie session store
  protect_from_forgery # :secret => '14fef7d49789580d8e38f47a3bd62c30'

  # Initialize GetText and Content-Type.
  # You need to call this once a request from WWW browser.
  # You can select the scope of the textdomain.
  # 1. If you call init_gettext in ApplicationControler,
  #    The textdomain apply whole your application.
  # 2. If you call init_gettext in each controllers
  #    (In this sample, blog_controller.rb is applicable)
  #    The textdomains are applied to each controllers/views.
  init_gettext "blog"  # textdomain, options(:charset, :content_type)

=begin
  # You can set callback methods. These methods are called on the each WWW request.
  def before_init_gettext(cgi)
    p "before_init_gettext"
  end
  def after_init_gettext(cgi)
    p "after_init_gettext"
  end
=end

=begin
  # you can redefined the title/explanation of the top of the error message.
  ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_title(N_("An error is occured on %{record}"), N_("%{num} errors are occured on %{record}"))
  ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_explanation(N_("The error is:"), N_("The errors are:"))
=end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gettext-1.90.0 samples/rails/app/controllers/application.rb
gettext-1.91.0 samples/rails/app/controllers/application.rb
gettext-1.92.0 samples/rails/app/controllers/application.rb
gettext-1.93.0 samples/rails/app/controllers/application.rb