Sha256: 4df56b1beb53fba7e631a4f352f2766733a53783633607f3cc9540c9712e4301
Contents?: true
Size: 1.07 KB
Versions: 6
Compression:
Stored size: 1.07 KB
Contents
# application.rb - a sample script for Ruby on Rails # # Copyright (C) 2005 Masao Mutoh # # This file is distributed under the same license as Ruby-GetText-Package. # Require 'gettext/rails' first. require 'gettext/rails' class ApplicationController < ActionController::Base # 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, charset = "UTF-8", content_type = "text/html" =begin # You can override the main part of "init_gettext" by yourself. def init_gettext_main GetText.output_charset = "UTF-8" bindtextdomain("blog", request.cgi) #You need to pass CGI object first. @headers["Content-Type"] = "text/html; charset=#{GetText.output_charset}" end =end end
Version data entries
6 entries across 6 versions & 1 rubygems