diff -r 15fc78ae1d8e app/controllers/application.rb --- a/app/controllers/application.rb Mon Oct 15 04:47:30 2007 +0900 +++ b/app/controllers/application.rb Mon Oct 15 05:05:10 2007 +0900 @@ -2,6 +2,8 @@ # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base + init_gettext "sti-sample" + # Pick a unique cookie name to distinguish our session data from others' session :session_key => '_sti-sample_session_id' end diff -r 15fc78ae1d8e config/environment.rb --- a/config/environment.rb Mon Oct 15 04:47:30 2007 +0900 +++ b/config/environment.rb Mon Oct 15 05:09:24 2007 +0900 @@ -58,3 +58,4 @@ end # Mime::Type.register "application/x-mobile", :mobile # Include your application configuration below +require "gettext/rails" diff -r 15fc78ae1d8e app/models/admin_user.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/models/admin_user.rb Mon Oct 15 04:54:17 2007 +0900 @@ -0,0 +1,2 @@ +class AdminUser < User +end diff -r 15fc78ae1d8e app/models/user.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/models/user.rb Mon Oct 15 04:52:17 2007 +0900 @@ -0,0 +1,2 @@ +class User < ActiveRecord::Base +end diff -r 15fc78ae1d8e db/migrate/001_create_users.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/migrate/001_create_users.rb Mon Oct 15 04:53:04 2007 +0900 @@ -0,0 +1,12 @@ +class CreateUsers < ActiveRecord::Migration + def self.up + create_table :users do |t| + t.column :type, :string, :null => false + t.column :name, :string + end + end + + def self.down + drop_table :users + end +end diff -r 15fc78ae1d8e lib/tasks/gettext.rake --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/tasks/gettext.rake Mon Oct 15 05:05:23 2007 +0900 @@ -0,0 +1,19 @@ +# -*- ruby -*- +# vim:set ft=ruby: + +desc "Update pot/po files." +task :updatepo do + require 'gettext/utils' + ENV["MSGMERGE_PATH"] ||= "msgmerge --sort-output" + GetText.update_pofiles( + "sti-sample", + Dir.glob("{app,config,lib}/**/*.{rb,rhtml,rjs}"), + "sti-sample 0.0.0" + ) +end + +desc "Create mo-files" +task :makemo do + require 'gettext/utils' + GetText.create_mofiles(true, "po", "locale") +end diff -r 15fc78ae1d8e po/ja/sti-sample.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/po/ja/sti-sample.po Mon Oct 15 05:09:04 2007 +0900 @@ -0,0 +1,29 @@ +# Japanese translations for PACKAGE package +# PACKAGE パッケージに対する英訳. +# Copyright (C) 2007 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Example , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2007-10-15 05:05+0900\n" +"PO-Revision-Date: 2007-10-15 05:06+0900\n" +"Last-Translator: Example \n" +"Language-Team: Japanese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: app/models/user.rb:- +msgid "user" +msgstr "ユーザ" + +#: app/models/user.rb:- +msgid "User|Type" +msgstr "型" + +#: app/models/user.rb:- +msgid "User|Name" +msgstr "名前" diff -r 15fc78ae1d8e po/sti-sample.pot --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/po/sti-sample.pot Mon Oct 15 05:05:47 2007 +0900 @@ -0,0 +1,29 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: sti-sample 0.0.0\n" +"POT-Creation-Date: 2007-10-15 05:05+0900\n" +"PO-Revision-Date: 2007-10-15 05:05+0900\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: app/models/user.rb:- +msgid "user" +msgstr "" + +#: app/models/user.rb:- +msgid "User|Type" +msgstr "" + +#: app/models/user.rb:- +msgid "User|Name" +msgstr ""