From ec9c19a1e6987d24f47d4d9d4f5f8c1419a5d439 Mon Sep 17 00:00:00 2001 From: nomeu Date: Wed, 9 Jun 2010 00:51:13 +0900 Subject: [PATCH] installed gettext --- app/controllers/application_controller.rb | 1 + app/controllers/welcome_controller.rb | 7 + app/helpers/welcome_helper.rb | 2 + app/views/arcs/index.html.erb | 10 +- app/views/layouts/arcs.html.erb | 13 +- app/views/welcome/index.html.erb | 2 + config/environment.rb | 5 + config/routes.rb | 2 +- lib/tasks/gettext.rake | 11 ++ locale/ja/LC_MESSAGES/nimono.mo | Bin 0 -> 1583 bytes po/ja/nimono.po | 133 ++++++++++++++ po/nimono.pot | 133 ++++++++++++++ public/index.html | 275 ----------------------------- test/functional/welcome_controller_test.rb | 8 + test/unit/helpers/welcome_helper_test.rb | 4 + 15 files changed, 321 insertions(+), 285 deletions(-) create mode 100644 app/controllers/welcome_controller.rb create mode 100644 app/helpers/welcome_helper.rb create mode 100644 app/views/welcome/index.html.erb create mode 100644 lib/tasks/gettext.rake create mode 100644 locale/ja/LC_MESSAGES/nimono.mo create mode 100644 po/ja/nimono.po create mode 100644 po/nimono.pot delete mode 100644 public/index.html create mode 100644 test/functional/welcome_controller_test.rb create mode 100644 test/unit/helpers/welcome_helper_test.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6635a3f..711a909 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,4 +7,5 @@ class ApplicationController < ActionController::Base # Scrub sensitive parameters from your log # filter_parameter_logging :password + init_gettext "nimono" end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb new file mode 100644 index 0000000..f197c70 --- /dev/null +++ b/app/controllers/welcome_controller.rb @@ -0,0 +1,7 @@ +class WelcomeController < ApplicationController + layout 'arcs' + + def index + end + +end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb new file mode 100644 index 0000000..eeead45 --- /dev/null +++ b/app/helpers/welcome_helper.rb @@ -0,0 +1,2 @@ +module WelcomeHelper +end diff --git a/app/views/arcs/index.html.erb b/app/views/arcs/index.html.erb index e776fd4..a644157 100644 --- a/app/views/arcs/index.html.erb +++ b/app/views/arcs/index.html.erb @@ -11,11 +11,11 @@ - - - - - + + + + + diff --git a/app/views/layouts/arcs.html.erb b/app/views/layouts/arcs.html.erb index 34597e0..ea1dcb0 100644 --- a/app/views/layouts/arcs.html.erb +++ b/app/views/layouts/arcs.html.erb @@ -9,14 +9,19 @@
+
+
+ <%= link_to "Home", root_path %> +
+
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb new file mode 100644 index 0000000..0a01a01 --- /dev/null +++ b/app/views/welcome/index.html.erb @@ -0,0 +1,2 @@ +

Welcome#index

+

Find me in app/views/welcome/index.html.erb

diff --git a/config/environment.rb b/config/environment.rb index 7092a6f..554590c 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -16,6 +16,11 @@ Rails::Initializer.run do |config| # Specify gems that this application depends on and have them installed with rake gems:install config.gem "will_paginate", :lib => "will_paginate" + config.gem "locale" + config.gem "locale_rails", :version => "2.0.5" + config.gem "gettext" + config.gem "gettext_activerecord", :version => "2.1.0" + config.gem "gettext_rails", :version => "2.1.0" # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named diff --git a/config/routes.rb b/config/routes.rb index 7e67518..1ba33d7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -41,7 +41,7 @@ ActionController::Routing::Routes.draw do |map| # end # You can have the root of your site routed with map.root -- just remember to delete public/index.html. - # map.root :controller => "welcome" + map.root :controller => "welcome" # See how all your routes lay out with "rake routes" diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake new file mode 100644 index 0000000..eb54f7b --- /dev/null +++ b/lib/tasks/gettext.rake @@ -0,0 +1,11 @@ +desc "Update pot/po files." +task :updatepo do + require 'gettext_rails/tools' + GetText.update_pofiles("nimono", Dir.glob("{app,config,lib}/**/*.{rb,erb}"), "nimono 1.0.0") +end + +desc "Create mo-files" +task :makemo do + require 'gettext_rails/tools' + GetText.create_mofiles +end diff --git a/locale/ja/LC_MESSAGES/nimono.mo b/locale/ja/LC_MESSAGES/nimono.mo new file mode 100644 index 0000000000000000000000000000000000000000..1bada4b96730c206ecf711d22a1e07e6b099a6f4 GIT binary patch literal 1583 zcmcJNOK1~87{^DgT4Q}b>a*;{LzS&t5v_@>hIU&5+cdOE&Beo-Y}1wOZrE%~74e0L zqKA6$g(7-T#0Ll}SW)pJ9=sI~o-9HWm7ctbc<}%2er+Q5>X6BA{`39kn{Q|4^U9jb z0<8gk6MEeoAsWHoAhp|bg{TGZfJ?y#;9_tLtOMUM$9aANB;ORc1pEcA0&C|5dK0)D zdMilt5pW^c1Jb$!AniB6+Tr+d)@M0>ne{DjKKzeCs^=-V0DQ~(J&2$9h(F5viS-v| z38YW`4#qK<0&AedNJ{zkfr~&5q`dtgIpPq4lS(z;7Le~tBB){j71 zH^%x6$3L(h=lBHcNsj+u{gdPKu?f`?0%^Z`W&?;%5?h#!AbqdQq`Ry~r@N=N0(}iS z-38@ajZXJNjq0RE_qNg>1!u90#{}Ao8m?WeN2fPH4Q2Z0xWQM!8(4=i$`EVOH}d>u zklrG-5dB5n%&~SSYXk$=&^;q7>7Fmu5zp4GAf!1N-7_8A5A?WZZYI(RmHQ31h_ebywrM%GBQ-ZEO-d-y zla&1`5RyA^PGM<>(yYkJE?LF$b*?mgj)AXVzCtckx=5^0; z!%}BT)1-K`Tb1^z-O-q~KibjJtM>J^g*4sH4e2>UP8zxumb7TRD;4d6Pt*42%_hgq zwS~H4-D;(D)EsJeY|pT<$B_bx^^6g3dm*ozc0|ey>Tc2ST2skRxuxQxS_TYPR_%u5LcB#D)DVS(g(+R3J))S9}g#RcfU*9aB z8!cbGTfTl;lrP*Vy?S1HJSxiPPnK@p7c> literal 0 HcmV?d00001 diff --git a/po/ja/nimono.po b/po/ja/nimono.po new file mode 100644 index 0000000..eaaf238 --- /dev/null +++ b/po/ja/nimono.po @@ -0,0 +1,133 @@ +# 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: nimono 1.0.0\n" +"POT-Creation-Date: 2010-06-09 00:47+0900\n" +"PO-Revision-Date: 2010-06-09 00:40+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/arc.rb:- +msgid "arc" +msgstr "書庫" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:14 +msgid "Arc|Code" +msgstr "Code" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:15 +msgid "Arc|Extname" +msgstr "拡張子" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:16 +msgid "Arc|Location" +msgstr "所在" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:17 +msgid "Arc|Summary" +msgstr "要約" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:18 +msgid "Arc|Origname" +msgstr "Origname" + +#: app/models/arc.rb:- +msgid "Arc|Created at" +msgstr "作成日時" + +#: app/models/arc.rb:- +msgid "Arc|Updated at" +msgstr "更新日時" + +#: app/models/location.rb:- +msgid "location" +msgstr "所在" + +#: app/models/location.rb:- +msgid "Location|Code" +msgstr "Code" + +#: app/models/location.rb:- +msgid "Location|Site" +msgstr "Site" + +#: app/models/location.rb:- +msgid "Location|Summary" +msgstr "要約" + +#: app/models/location.rb:- +msgid "Location|Created at" +msgstr "作成日時" + +#: app/models/location.rb:- +msgid "Location|Updated at" +msgstr "更新日時" + +#: app/models/pmd.rb:- +msgid "pmd" +msgstr "pmd" + +#: app/models/pmd.rb:- +msgid "Pmd|Arc" +msgstr "書庫" + +#: app/models/pmd.rb:- +msgid "Pmd|Path" +msgstr "Path" + +#: app/models/pmd.rb:- +msgid "Pmd|Created at" +msgstr "作成日時" + +#: app/models/pmd.rb:- +msgid "Pmd|Updated at" +msgstr "更新日時" + +#: app/models/vmd.rb:- +msgid "vmd" +msgstr "vmd" + +#: app/models/vmd.rb:- +msgid "Vmd|Arc" +msgstr "書庫" + +#: app/models/vmd.rb:- +msgid "Vmd|Path" +msgstr "Path" + +#: app/models/vmd.rb:- +msgid "Vmd|Created at" +msgstr "作成日時" + +#: app/models/vmd.rb:- +msgid "Vmd|Updated at" +msgstr "更新日時" + +#: app/models/x.rb:- +msgid "x" +msgstr "x" + +#: app/models/x.rb:- +msgid "X|Arc" +msgstr "書庫" + +#: app/models/x.rb:- +msgid "X|Path" +msgstr "Path" + +#: app/models/x.rb:- +msgid "X|Created at" +msgstr "作成日時" + +#: app/models/x.rb:- +msgid "X|Updated at" +msgstr "更新日時" diff --git a/po/nimono.pot b/po/nimono.pot new file mode 100644 index 0000000..9f2fb04 --- /dev/null +++ b/po/nimono.pot @@ -0,0 +1,133 @@ +# 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: nimono 1.0.0\n" +"POT-Creation-Date: 2010-06-09 00:47+0900\n" +"PO-Revision-Date: 2010-06-09 00:40+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/arc.rb:- +msgid "arc" +msgstr "" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:14 +msgid "Arc|Code" +msgstr "" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:15 +msgid "Arc|Extname" +msgstr "" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:16 +msgid "Arc|Location" +msgstr "" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:17 +msgid "Arc|Summary" +msgstr "" + +#: app/models/arc.rb:- app/views/arcs/index.html.erb:18 +msgid "Arc|Origname" +msgstr "" + +#: app/models/arc.rb:- +msgid "Arc|Created at" +msgstr "" + +#: app/models/arc.rb:- +msgid "Arc|Updated at" +msgstr "" + +#: app/models/location.rb:- +msgid "location" +msgstr "" + +#: app/models/location.rb:- +msgid "Location|Code" +msgstr "" + +#: app/models/location.rb:- +msgid "Location|Site" +msgstr "" + +#: app/models/location.rb:- +msgid "Location|Summary" +msgstr "" + +#: app/models/location.rb:- +msgid "Location|Created at" +msgstr "" + +#: app/models/location.rb:- +msgid "Location|Updated at" +msgstr "" + +#: app/models/pmd.rb:- +msgid "pmd" +msgstr "" + +#: app/models/pmd.rb:- +msgid "Pmd|Arc" +msgstr "" + +#: app/models/pmd.rb:- +msgid "Pmd|Path" +msgstr "" + +#: app/models/pmd.rb:- +msgid "Pmd|Created at" +msgstr "" + +#: app/models/pmd.rb:- +msgid "Pmd|Updated at" +msgstr "" + +#: app/models/vmd.rb:- +msgid "vmd" +msgstr "" + +#: app/models/vmd.rb:- +msgid "Vmd|Arc" +msgstr "" + +#: app/models/vmd.rb:- +msgid "Vmd|Path" +msgstr "" + +#: app/models/vmd.rb:- +msgid "Vmd|Created at" +msgstr "" + +#: app/models/vmd.rb:- +msgid "Vmd|Updated at" +msgstr "" + +#: app/models/x.rb:- +msgid "x" +msgstr "" + +#: app/models/x.rb:- +msgid "X|Arc" +msgstr "" + +#: app/models/x.rb:- +msgid "X|Path" +msgstr "" + +#: app/models/x.rb:- +msgid "X|Created at" +msgstr "" + +#: app/models/x.rb:- +msgid "X|Updated at" +msgstr "" diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 0dd5189..0000000 --- a/public/index.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - - Ruby on Rails: Welcome aboard - - - - - - -
- - -
- - - - -
-

Getting started

-

Here’s how to get rolling:

- -
    -
  1. -

    Use script/generate to create your models and controllers

    -

    To see all available options, run it without parameters.

    -
  2. - -
  3. -

    Set up a default route and remove or rename this file

    -

    Routes are set up in config/routes.rb.

    -
  4. - -
  5. -

    Create your database

    -

    Run rake db:migrate to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    -
  6. -
-
-
- - -
- - \ No newline at end of file diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb new file mode 100644 index 0000000..92c7f5a --- /dev/null +++ b/test/functional/welcome_controller_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class WelcomeControllerTest < ActionController::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end diff --git a/test/unit/helpers/welcome_helper_test.rb b/test/unit/helpers/welcome_helper_test.rb new file mode 100644 index 0000000..d6ded59 --- /dev/null +++ b/test/unit/helpers/welcome_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class WelcomeHelperTest < ActionView::TestCase +end -- 2.11.0
CodeExtnameLocationSummaryOrigname<%= _'Arc|Code' %><%= _'Arc|Extname' %><%= _'Arc|Location' %><%= _'Arc|Summary' %><%= _'Arc|Origname' %>