gettext 1.0.0-mswin32 → 1.1.0-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +193 -0
- data/NEWS +51 -1
- data/README +29 -11
- data/Rakefile +70 -56
- data/bin/rgettext +2 -0
- data/bin/rmsgfmt +2 -0
- data/bin/rmsgmerge +24 -0
- data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
- data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
- data/ext/gettext/gettext/_locale.BAK +86 -0
- data/ext/gettext/gettext/_locale.c +1 -1
- data/ext/gettext/gettext/_locale.exp +0 -0
- data/ext/gettext/gettext/_locale.lib +0 -0
- data/ext/gettext/gettext/_locale.obj +0 -0
- data/ext/gettext/gettext/_locale.pdb +0 -0
- data/ext/gettext/gettext/_locale.so +0 -0
- data/ext/gettext/gettext/mkmf.log +4 -4
- data/ext/gettext/gettext/vc70.pdb +0 -0
- data/lib/_locale.so +0 -0
- data/lib/gettext.rb +17 -4
- data/lib/gettext/cgi.rb +34 -19
- data/lib/gettext/locale.rb +3 -13
- data/lib/gettext/locale_default.rb +2 -2
- data/lib/gettext/locale_win32.rb +27 -7
- data/lib/gettext/mo.rb +6 -1
- data/lib/gettext/parser/activerecord.rb +115 -0
- data/lib/gettext/parser/glade.rb +3 -1
- data/lib/gettext/parser/ruby.rb +56 -57
- data/lib/gettext/poparser.rb +297 -0
- data/lib/gettext/rails.rb +161 -3
- data/lib/gettext/rgettext.rb +19 -9
- data/lib/gettext/rmsgfmt.rb +95 -363
- data/lib/gettext/rmsgmerge.rb +381 -0
- data/lib/gettext/string.rb +26 -0
- data/lib/gettext/textdomain.rb +21 -18
- data/lib/gettext/utils.rb +55 -0
- data/lib/gettext/version.rb +1 -1
- data/po/cs/rails.po +83 -0
- data/po/cs/rgettext.po +104 -0
- data/po/de/rails.po +79 -0
- data/po/de/rgettext.po +72 -21
- data/po/es/rails.po +80 -0
- data/po/es/rgettext.po +75 -19
- data/po/fr/rails.po +81 -0
- data/po/fr/rgettext.po +75 -19
- data/po/it/rgettext.po +68 -17
- data/po/ja/rails.po +78 -0
- data/po/ja/rgettext.po +71 -20
- data/po/ko/rails.po +77 -0
- data/po/ko/rgettext.po +74 -22
- data/po/nl/rails.po +80 -0
- data/po/nl/rgettext.po +102 -0
- data/po/pt_BR/rails.po +79 -0
- data/po/pt_BR/rgettext.po +77 -24
- data/po/rails.pot +80 -0
- data/po/rgettext.pot +63 -13
- data/po/sv/rgettext.po +63 -15
- data/samples/cgi/cookie.cgi +5 -0
- data/samples/cgi/helloerb1.cgi +4 -0
- data/samples/cgi/helloerb2.cgi +5 -0
- data/samples/cgi/index.cgi +5 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/cs/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/fr/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/ko/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/ko/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/ko/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/ko/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/nl/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/nl/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/nl/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/nl/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/locale/pt_BR/LC_MESSAGES/helloerb1.mo +0 -0
- data/samples/cgi/locale/pt_BR/LC_MESSAGES/helloerb2.mo +0 -0
- data/samples/cgi/locale/pt_BR/LC_MESSAGES/hellolib.mo +0 -0
- data/samples/cgi/locale/pt_BR/LC_MESSAGES/main.mo +0 -0
- data/samples/cgi/po/cs/helloerb1.po +66 -0
- data/samples/cgi/po/cs/helloerb2.po +52 -0
- data/samples/cgi/po/cs/hellolib.po +25 -0
- data/samples/cgi/po/cs/main.po +78 -0
- data/samples/cgi/po/fr/main.po +8 -8
- data/samples/cgi/po/ko/helloerb1.po +2 -3
- data/samples/cgi/po/ko/helloerb2.po +1 -2
- data/samples/cgi/po/ko/hellolib.po +1 -2
- data/samples/cgi/po/ko/main.po +2 -3
- data/samples/cgi/po/nl/helloerb1.po +60 -0
- data/samples/cgi/po/nl/helloerb2.po +52 -0
- data/samples/cgi/po/nl/hellolib.po +24 -0
- data/samples/cgi/po/nl/main.po +76 -0
- data/samples/cgi/po/pt_BR/helloerb1.po +59 -0
- data/samples/cgi/po/pt_BR/helloerb2.po +51 -0
- data/samples/cgi/po/pt_BR/hellolib.po +22 -0
- data/samples/cgi/po/pt_BR/main.po +75 -0
- data/samples/locale/cs/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/cs/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/fr/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/ko/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/nl/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello2.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello_noop.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hello_plural.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/helloglade2.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hellogtk.mo +0 -0
- data/samples/locale/pt_BR/LC_MESSAGES/hellotk.mo +0 -0
- data/samples/po/cs/hello.po +23 -0
- data/samples/po/cs/hello2.po +31 -0
- data/samples/po/cs/hello_noop.po +27 -0
- data/samples/po/cs/hello_plural.po +26 -0
- data/samples/po/cs/helloglade2.po +37 -0
- data/samples/po/cs/hellogtk.po +23 -0
- data/samples/po/cs/hellotk.po +23 -0
- data/samples/po/fr/helloglade2.po +2 -2
- data/samples/po/hello.pot +1 -0
- data/samples/po/hello2.pot +1 -0
- data/samples/po/hello_noop.pot +2 -1
- data/samples/po/hello_plural.pot +6 -2
- data/samples/po/helloglade2.pot +8 -3
- data/samples/po/hellotk.pot +4 -0
- data/samples/po/ko/hello.po +1 -2
- data/samples/po/ko/hello2.po +1 -2
- data/samples/po/ko/hello_noop.po +1 -2
- data/samples/po/ko/hello_plural.po +1 -2
- data/samples/po/ko/helloglade2.po +2 -2
- data/samples/po/ko/hellogtk.po +1 -2
- data/samples/po/ko/hellotk.po +1 -2
- data/samples/po/nl/hello.po +24 -0
- data/samples/po/nl/hello2.po +32 -0
- data/samples/po/nl/hello_noop.po +28 -0
- data/samples/po/nl/hello_plural.po +26 -0
- data/samples/po/nl/helloglade2.po +31 -0
- data/samples/po/nl/hellogtk.po +24 -0
- data/samples/po/nl/hellotk.po +24 -0
- data/samples/po/pt_BR/hello.po +6 -5
- data/samples/po/pt_BR/hello2.po +6 -5
- data/samples/po/pt_BR/hello_noop.po +6 -5
- data/samples/po/pt_BR/hello_plural.po +6 -6
- data/samples/po/pt_BR/helloglade2.po +6 -5
- data/samples/po/pt_BR/hellogtk.po +6 -5
- data/samples/po/pt_BR/hellotk.po +6 -5
- data/samples/rails/README +21 -15
- data/samples/rails/Rakefile +10 -1
- data/samples/rails/app/controllers/application.rb +10 -18
- data/samples/rails/app/controllers/blog_controller.rb +1 -5
- data/samples/rails/app/helpers/blog_helper.rb +1 -1
- data/samples/rails/app/models/article.rb +15 -0
- data/samples/rails/app/views/blog/_form.rhtml +2 -2
- data/samples/rails/config/boot.rb +17 -0
- data/samples/rails/config/database.yml +6 -4
- data/samples/rails/config/environment.rb +40 -75
- data/samples/rails/config/environments/development.rb +12 -7
- data/samples/rails/config/environments/production.rb +17 -6
- data/samples/rails/config/environments/test.rb +8 -6
- data/samples/rails/locale/cs/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/de/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/de/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/en/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/es/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/es/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/fr/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/fr/LC_MESSAGES/{lang_helper.mo → gettext_plugin.mo} +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ja/LC_MESSAGES/{lang_helper.mo → gettext_plugin.mo} +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/nl/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/locale/pt_BR/LC_MESSAGES/blog.mo +0 -0
- data/samples/rails/locale/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
- data/samples/rails/po/blog.pot +57 -37
- data/samples/rails/po/cs/blog.po +116 -0
- data/samples/rails/po/cs/gettext_plugin.po +29 -0
- data/samples/rails/po/de/blog.po +70 -51
- data/samples/rails/po/de/{lang_helper.po → gettext_plugin.po} +4 -5
- data/samples/rails/po/en/blog.po +111 -0
- data/samples/rails/po/es/blog.po +67 -47
- data/samples/rails/po/es/{lang_helper.po → gettext_plugin.po} +5 -5
- data/samples/rails/po/fr/blog.po +65 -45
- data/samples/rails/po/fr/{lang_helper.po → gettext_plugin.po} +4 -4
- data/samples/rails/po/{lang_helper.pot → gettext_plugin.pot} +4 -4
- data/samples/rails/po/ja/blog.po +64 -44
- data/samples/rails/po/ja/{lang_helper.po → gettext_plugin.po} +4 -4
- data/samples/rails/po/ko/blog.po +65 -46
- data/samples/rails/po/ko/{lang_helper.po → gettext_plugin.po} +5 -6
- data/samples/rails/po/nl/blog.po +115 -0
- data/samples/rails/po/nl/gettext_plugin.po +28 -0
- data/samples/rails/po/pt_BR/blog.po +109 -0
- data/samples/rails/po/pt_BR/gettext_plugin.po +27 -0
- data/samples/rails/public/images/rails.png +0 -0
- data/samples/rails/public/index.html +272 -71
- data/samples/rails/public/javascripts/controls.js +441 -166
- data/samples/rails/public/javascripts/dragdrop.js +261 -279
- data/samples/rails/public/javascripts/effects.js +657 -277
- data/samples/rails/public/javascripts/prototype.js +911 -223
- data/samples/rails/public/robots.txt +1 -0
- data/samples/rails/public/stylesheets/scaffold.css +1 -1
- data/samples/rails/script/about +3 -0
- data/samples/rails/script/breakpointer +3 -4
- data/samples/rails/script/console +3 -23
- data/samples/rails/script/destroy +3 -7
- data/samples/rails/script/generate +3 -7
- data/samples/rails/script/performance/benchmarker +3 -0
- data/samples/rails/script/performance/profiler +3 -0
- data/samples/rails/script/plugin +3 -0
- data/samples/rails/script/process/reaper +3 -0
- data/samples/rails/script/process/spawner +3 -0
- data/samples/rails/script/process/spinner +3 -0
- data/samples/rails/script/runner +3 -29
- data/samples/rails/script/server +3 -49
- data/samples/rails/vendor/plugins/gettext/init.rb +19 -0
- data/samples/rails/vendor/{lang_helper.rb → plugins/gettext/lib/gettext_plugin.rb} +15 -11
- data/src/poparser.ry +171 -0
- data/test/gettext_runner.rb +3 -1
- data/test/gettext_test.rb +56 -31
- data/test/gettext_test_cgi.rb +12 -0
- data/test/gettext_test_parser.rb +3 -0
- data/test/gettext_test_string.rb +14 -0
- data/test/locale/cr/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/da/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/da/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/fr/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/fr/LC_MESSAGES/plural_error.mo +0 -0
- data/test/locale/ir/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/la/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/li/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/po/LC_MESSAGES/plural.mo +0 -0
- data/test/locale/sl/LC_MESSAGES/plural.mo +0 -0
- data/test/po/cr/plural.po +3 -3
- data/test/po/da/plural.po +2 -2
- data/test/po/da/plural_error.po +2 -1
- data/test/po/fr/plural.po +2 -2
- data/test/po/fr/plural_error.po +2 -1
- data/test/po/ir/plural.po +3 -3
- data/test/po/la/plural.po +3 -3
- data/test/po/li/plural.po +3 -3
- data/test/po/po/plural.po +3 -3
- data/test/po/sl/plural.po +4 -4
- data/test/test.sh +1 -0
- data/test/test_rubyparser.rb +20 -0
- data/test/{test_rubyparser_n.rb → test_rubyparser_N.rb} +0 -0
- metadata +163 -43
- data/README.ja +0 -115
- data/data/locale/de/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/es/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/it/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/data/locale/sv/LC_MESSAGES/rmsgfmt.mo +0 -0
- data/gettext-1.0.0-mswin32.gem +0 -0
- data/po/de/rmsgfmt.po +0 -45
- data/po/es/rmsgfmt.po +0 -43
- data/po/fr/rmsgfmt.po +0 -43
- data/po/it/rmsgfmt.po +0 -44
- data/po/ja/rmsgfmt.po +0 -43
- data/po/ko/rmsgfmt.po +0 -40
- data/po/pt_BR/rmsgfmt.po +0 -42
- data/po/rmsgfmt.pot +0 -40
- data/po/sv/rmsgfmt.po +0 -43
- data/samples/rails/locale/de/LC_MESSAGES/lang_helper.mo +0 -0
- data/samples/rails/locale/es/LC_MESSAGES/lang_helper.mo +0 -0
- data/samples/rails/locale/ko/LC_MESSAGES/lang_helper.mo +0 -0
- data/samples/rails/log/development.log +0 -378
- data/src/rmsgfmt.ry +0 -233
data/samples/rails/Rakefile
CHANGED
@@ -204,9 +204,18 @@ end
|
|
204
204
|
#
|
205
205
|
# Added for Ruby-GetText-Package
|
206
206
|
#
|
207
|
-
|
207
|
+
|
208
|
+
require 'gettext/utils'
|
208
209
|
desc "Create mo-files for L10n"
|
209
210
|
task :makemo do
|
210
211
|
GetText.create_mofiles(true, "po", "locale")
|
211
212
|
end
|
212
213
|
|
214
|
+
desc "Update pot/po files to match new version."
|
215
|
+
task :updatepo do
|
216
|
+
GetText.update_pofiles("blog", Dir.glob("{app,lib}/**/*.{rb,rhtml}"),
|
217
|
+
"blog 1.1.0")
|
218
|
+
|
219
|
+
GetText.update_pofiles("gettext_plugin", Dir.glob("vendor/**/*.{rb,rhtml}"),
|
220
|
+
"gettext_plugin 1.1.0")
|
221
|
+
end
|
@@ -7,31 +7,23 @@
|
|
7
7
|
# Require 'gettext/rails' first.
|
8
8
|
require 'gettext/rails'
|
9
9
|
|
10
|
-
# lang_helper is sample helper. It has its own textdomain(lang_helper).
|
11
|
-
# (See vendor/lang_helper.rb).
|
12
|
-
require 'lang_helper'
|
13
|
-
|
14
10
|
class ApplicationController < ActionController::Base
|
15
|
-
# for lang_helper.
|
16
|
-
helper LangHelper
|
17
|
-
include LangHelper
|
18
|
-
|
19
11
|
# Initialize GetText and Content-Type.
|
20
12
|
# You need to call this once a request from WWW browser.
|
21
13
|
# You can select the scope of the textdomain.
|
22
|
-
# 1. If you call
|
14
|
+
# 1. If you call init_gettext in ApplicationControler,
|
23
15
|
# The textdomain apply whole your application.
|
24
|
-
# 2. If you call
|
16
|
+
# 2. If you call init_gettext in each controllers
|
25
17
|
# (In this sample, blog_controller.rb is applicable)
|
26
18
|
# The textdomains are applied to each controllers/views.
|
27
|
-
|
28
|
-
def init_gettext
|
29
|
-
# The locale is set automatically or use Cookie value, parameter "lang".
|
30
|
-
bindtextdomain("blog", request.cgi) #You need to pass CGI object first.
|
19
|
+
init_gettext "blog" # textdomain, charset = "UTF-8", content_type = "text/html"
|
31
20
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
21
|
+
=begin
|
22
|
+
# You can override the main part of "init_gettext" by yourself.
|
23
|
+
def init_gettext_main
|
24
|
+
GetText.output_charset = "UTF-8"
|
25
|
+
bindtextdomain("blog", request.cgi) #You need to pass CGI object first.
|
26
|
+
@headers["Content-Type"] = "text/html; charset=#{GetText.output_charset}"
|
36
27
|
end
|
28
|
+
=end
|
37
29
|
end
|
@@ -8,11 +8,7 @@ class BlogController < ApplicationController
|
|
8
8
|
# If you want to have textdomains each as controllers.
|
9
9
|
# You need to bind textdomain here.
|
10
10
|
|
11
|
-
|
12
|
-
#def init_gettext
|
13
|
-
# bindtextdomain("blog", request.cgi) #You need to pass CGI object first.
|
14
|
-
# @headers["Content-Type"] = "text/html; charset=UTF-8"
|
15
|
-
#end
|
11
|
+
init_gettext "blog"
|
16
12
|
|
17
13
|
def index
|
18
14
|
list
|
@@ -35,7 +35,7 @@ module BlogHelper
|
|
35
35
|
articles = BlogController.new.list
|
36
36
|
%Q[
|
37
37
|
<div class="navigation">
|
38
|
-
<img src="
|
38
|
+
<img src="/images/rails.png" width="100" height="100" />
|
39
39
|
<div class="window">
|
40
40
|
#{show_language}
|
41
41
|
</div>
|
@@ -1,2 +1,17 @@
|
|
1
1
|
class Article < ActiveRecord::Base
|
2
|
+
# With default error messages.
|
3
|
+
validates_presence_of :title
|
4
|
+
validates_length_of :description, :minimum => 10
|
5
|
+
|
6
|
+
|
7
|
+
# With your own message with L10n.
|
8
|
+
# old style(Backward compatibility).
|
9
|
+
# blog.po in RAILS_ROOT/po/*/ is used.
|
10
|
+
# validates_presence_of :title, :message => _("can't be empty")
|
11
|
+
# validates_length_of :description, :minimum => 10, :message => _("is too short (min is %d characters)")
|
12
|
+
|
13
|
+
# new style (you can use %{fn} and %d freely in the message)
|
14
|
+
# blog.po in RAILS_ROOT/po/*/ is used.
|
15
|
+
# validates_presence_of :title, :message => _("%{fn} can't be empty!")
|
16
|
+
# validates_length_of :description, :minimum => 10, :message => _("%{fn} is too short (min is %d characters)")
|
2
17
|
end
|
@@ -15,10 +15,10 @@
|
|
15
15
|
<!--[form:article]-->
|
16
16
|
<p><label for="article_lastupdate"><%= _("Lastupdate") %></label><br/>
|
17
17
|
<%= date_select 'article', 'lastupdate', :use_month_numbers => true %></p>
|
18
|
-
<p><label for="article_title"><%= _("Title") %></label><br/>
|
18
|
+
<p><label for="article_title"><%= _("Title: Required.") %></label><br/>
|
19
19
|
<%= text_field 'article', 'title' %></p>
|
20
20
|
|
21
|
-
<p><label for="article_description"><%= _("Description") %></label><br/>
|
21
|
+
<p><label for="article_description"><%= _("Description: More than 10 characters.") %></label><br/>
|
22
22
|
<%= text_area 'article', 'description' %></p>
|
23
23
|
|
24
24
|
<!--[eoform:article]-->
|
@@ -0,0 +1,17 @@
|
|
1
|
+
unless defined?(RAILS_ROOT)
|
2
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
3
|
+
unless RUBY_PLATFORM =~ /mswin32/
|
4
|
+
require 'pathname'
|
5
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
6
|
+
end
|
7
|
+
RAILS_ROOT = root_path
|
8
|
+
end
|
9
|
+
|
10
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
11
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
12
|
+
else
|
13
|
+
require 'rubygems'
|
14
|
+
require 'initializer'
|
15
|
+
end
|
16
|
+
|
17
|
+
Rails::Initializer.run(:set_load_path)
|
@@ -5,13 +5,13 @@ development:
|
|
5
5
|
database: blog
|
6
6
|
host: localhost
|
7
7
|
username: root
|
8
|
-
password:
|
8
|
+
password:
|
9
9
|
|
10
10
|
#development:
|
11
11
|
# adapter: postgresql
|
12
12
|
# database: blog
|
13
13
|
# host: localhost
|
14
|
-
# username:
|
14
|
+
# username: postgres
|
15
15
|
# password:
|
16
16
|
|
17
17
|
# Warning: The database defined as 'test' will be erased and
|
@@ -26,7 +26,9 @@ test:
|
|
26
26
|
|
27
27
|
production:
|
28
28
|
adapter: mysql
|
29
|
-
|
29
|
+
socket: /var/lib/mysql/mysql.sock
|
30
|
+
# socket: /tmp/mysql.sock
|
31
|
+
database: blog
|
30
32
|
host: localhost
|
31
33
|
username: root
|
32
|
-
password:
|
34
|
+
password:
|
@@ -1,88 +1,53 @@
|
|
1
|
-
#
|
2
|
-
# You can include your own configuration at the end of this file.
|
3
|
-
#
|
4
|
-
# Be sure to restart your webserver when you modify this file.
|
1
|
+
# Be sure to restart your web server when you modify this file.
|
5
2
|
|
6
|
-
|
3
|
+
# Uncomment below to force Rails into production mode when
|
4
|
+
# you don't control web/app server and can't set it the proper way
|
5
|
+
# ENV['RAILS_ENV'] ||= 'production'
|
7
6
|
|
8
|
-
#
|
9
|
-
|
7
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
8
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
10
9
|
|
11
|
-
|
12
|
-
#
|
13
|
-
|
14
|
-
#
|
15
|
-
#
|
16
|
-
RAILS_ENV = ENV['RAILS_ENV'] || 'development'
|
10
|
+
Rails::Initializer.run do |config|
|
11
|
+
# Settings in config/environments/* take precedence those specified here
|
12
|
+
|
13
|
+
# Skip frameworks you're not going to use
|
14
|
+
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
17
15
|
|
16
|
+
# Add additional load paths for your own custom dirs
|
17
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
18
18
|
|
19
|
-
#
|
20
|
-
|
19
|
+
# Force all environments to use the same logger level
|
20
|
+
# (by default production uses :info, the others :debug)
|
21
|
+
# config.log_level = :debug
|
21
22
|
|
22
|
-
#
|
23
|
-
|
24
|
-
|
23
|
+
# Use the database for sessions instead of the file system
|
24
|
+
# (create the session table with 'rake create_sessions_table')
|
25
|
+
# config.action_controller.session_store = :active_record_store
|
25
26
|
|
26
|
-
#
|
27
|
-
|
28
|
-
|
29
|
-
app/models
|
30
|
-
app/controllers
|
31
|
-
app/helpers
|
32
|
-
app/apis
|
33
|
-
components
|
34
|
-
config
|
35
|
-
lib
|
36
|
-
vendor
|
37
|
-
vendor/rails/railties
|
38
|
-
vendor/rails/railties/lib
|
39
|
-
vendor/rails/actionpack/lib
|
40
|
-
vendor/rails/activesupport/lib
|
41
|
-
vendor/rails/activerecord/lib
|
42
|
-
vendor/rails/actionmailer/lib
|
43
|
-
vendor/rails/actionwebservice/lib
|
44
|
-
).map { |dir| "#{RAILS_ROOT}/#{dir}" }.select { |dir| File.directory?(dir) }
|
27
|
+
# Enable page/fragment caching by setting a file-based store
|
28
|
+
# (remember to create the caching directory and make it readable to the application)
|
29
|
+
# config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
|
45
30
|
|
46
|
-
#
|
47
|
-
|
31
|
+
# Activate observers that should always be running
|
32
|
+
# config.active_record.observers = :cacher, :garbage_collector
|
48
33
|
|
49
|
-
#
|
50
|
-
|
34
|
+
# Make Active Record use UTC-base instead of local time
|
35
|
+
# config.active_record.default_timezone = :utc
|
36
|
+
|
37
|
+
# Use Active Record's schema dumper instead of SQL when creating the test database
|
38
|
+
# (enables use of different database adapters for development and test environments)
|
39
|
+
# config.active_record.schema_format = :ruby
|
51
40
|
|
52
|
-
|
53
|
-
require 'active_record'
|
54
|
-
require 'action_controller'
|
55
|
-
require 'action_mailer'
|
56
|
-
require 'action_web_service'
|
57
|
-
|
58
|
-
# Environment-specific configuration.
|
59
|
-
require_dependency "environments/#{RAILS_ENV}"
|
60
|
-
ActiveRecord::Base.configurations = File.open("#{RAILS_ROOT}/config/database.yml") { |f| YAML::load(f) }
|
61
|
-
ActiveRecord::Base.establish_connection
|
62
|
-
|
63
|
-
|
64
|
-
# Configure defaults if the included environment did not.
|
65
|
-
begin
|
66
|
-
RAILS_DEFAULT_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log")
|
67
|
-
RAILS_DEFAULT_LOGGER.level = (RAILS_ENV == 'production' ? Logger::INFO : Logger::DEBUG)
|
68
|
-
rescue StandardError
|
69
|
-
RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
|
70
|
-
RAILS_DEFAULT_LOGGER.level = Logger::WARN
|
71
|
-
RAILS_DEFAULT_LOGGER.warn(
|
72
|
-
"Rails Error: Unable to access log file. Please ensure that log/#{RAILS_ENV}.log exists and is chmod 0666. " +
|
73
|
-
"The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
|
74
|
-
)
|
41
|
+
# See Rails::Configuration for more options
|
75
42
|
end
|
76
43
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
#
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
File.join(RAILS_ROOT, 'components')
|
86
|
-
)
|
44
|
+
# Add new inflection rules using the following format
|
45
|
+
# (all these examples are active by default):
|
46
|
+
# Inflector.inflections do |inflect|
|
47
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
48
|
+
# inflect.singular /^(ox)en/i, '\1'
|
49
|
+
# inflect.irregular 'person', 'people'
|
50
|
+
# inflect.uncountable %w( fish sheep )
|
51
|
+
# end
|
87
52
|
|
88
|
-
# Include your
|
53
|
+
# Include your application configuration below
|
@@ -1,14 +1,19 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
1
3
|
# In the development environment your application's code is reloaded on
|
2
4
|
# every request. This slows down response time but is perfect for development
|
3
5
|
# since you don't have to restart the webserver when you make code changes.
|
6
|
+
config.cache_classes = false
|
4
7
|
|
5
8
|
# Log error messages when you accidentally call methods on nil.
|
6
|
-
|
9
|
+
config.whiny_nils = true
|
10
|
+
|
11
|
+
# Enable the breakpoint server that script/breakpointer connects to
|
12
|
+
config.breakpoint_server = true
|
7
13
|
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
ActionController::Base.perform_caching = false
|
14
|
+
# Show full error reports and disable caching
|
15
|
+
config.action_controller.consider_all_requests_local = true
|
16
|
+
config.action_controller.perform_caching = false
|
12
17
|
|
13
|
-
#
|
14
|
-
|
18
|
+
# Don't care if the mailer can't send
|
19
|
+
config.action_mailer.raise_delivery_errors = false
|
@@ -1,8 +1,19 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
1
3
|
# The production environment is meant for finished, "live" apps.
|
2
|
-
# Code is not reloaded between requests
|
3
|
-
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Use a different logger for distributed setups
|
8
|
+
# config.logger = SyslogLogger.new
|
9
|
+
|
10
|
+
|
11
|
+
# Full error reports are disabled and caching is turned on
|
12
|
+
config.action_controller.consider_all_requests_local = false
|
13
|
+
config.action_controller.perform_caching = true
|
14
|
+
|
15
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
16
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
4
17
|
|
5
|
-
#
|
6
|
-
|
7
|
-
ActionController::Base.consider_all_requests_local = false
|
8
|
-
ActionController::Base.perform_caching = true
|
18
|
+
# Disable delivery errors if you bad email addresses should just be ignored
|
19
|
+
# config.action_mailer.raise_delivery_errors = false
|
@@ -1,17 +1,19 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
1
3
|
# The test environment is used exclusively to run your application's
|
2
4
|
# test suite. You never need to work with it otherwise. Remember that
|
3
5
|
# your test database is "scratch space" for the test suite and is wiped
|
4
6
|
# and recreated between test runs. Don't rely on the data there!
|
7
|
+
config.cache_classes = true
|
5
8
|
|
6
9
|
# Log error messages when you accidentally call methods on nil.
|
7
|
-
|
10
|
+
config.whiny_nils = true
|
8
11
|
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
ActionController::Base.perform_caching = false
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
13
15
|
|
14
16
|
# Tell ActionMailer not to deliver emails to the real world.
|
15
17
|
# The :test delivery method accumulates sent emails in the
|
16
18
|
# ActionMailer::Base.deliveries array.
|
17
|
-
|
19
|
+
config.action_mailer.delivery_method = :test
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/samples/rails/po/blog.pot
CHANGED
@@ -9,8 +9,8 @@
|
|
9
9
|
#, fuzzy
|
10
10
|
msgid ""
|
11
11
|
msgstr ""
|
12
|
-
"Project-Id-Version: 1.0\n"
|
13
|
-
"POT-Creation-Date: 2005-
|
12
|
+
"Project-Id-Version: blog 1.1.0\n"
|
13
|
+
"POT-Creation-Date: 2005-12-23 01:29+0900\n"
|
14
14
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
15
15
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
16
16
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -19,72 +19,92 @@ msgstr ""
|
|
19
19
|
"Content-Transfer-Encoding: 8bit\n"
|
20
20
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
21
21
|
|
22
|
-
#: app/
|
23
|
-
msgid "
|
22
|
+
#: app/helpers/blog_helper.rb:43
|
23
|
+
msgid "Ruby Links"
|
24
24
|
msgstr ""
|
25
25
|
|
26
|
-
#: app/
|
27
|
-
msgid "
|
26
|
+
#: app/helpers/blog_helper.rb:51
|
27
|
+
msgid "Old articles"
|
28
28
|
msgstr ""
|
29
29
|
|
30
|
-
#: app/
|
31
|
-
msgid "
|
30
|
+
#: app/models/article.rb:-
|
31
|
+
msgid "Article"
|
32
32
|
msgstr ""
|
33
33
|
|
34
|
-
#: app/
|
35
|
-
msgid "
|
34
|
+
#: app/models/article.rb:-
|
35
|
+
msgid "Article|Id"
|
36
36
|
msgstr ""
|
37
37
|
|
38
|
-
#: app/
|
39
|
-
msgid "
|
38
|
+
#: app/models/article.rb:-
|
39
|
+
msgid "Article|Title"
|
40
40
|
msgstr ""
|
41
41
|
|
42
|
-
#: app/
|
43
|
-
msgid "
|
42
|
+
#: app/models/article.rb:-
|
43
|
+
msgid "Article|Description"
|
44
44
|
msgstr ""
|
45
45
|
|
46
|
-
#: app/
|
47
|
-
msgid "
|
46
|
+
#: app/models/article.rb:-
|
47
|
+
msgid "Article|Lastupdate"
|
48
48
|
msgstr ""
|
49
49
|
|
50
|
-
#: app/
|
51
|
-
msgid "
|
50
|
+
#: app/controllers/blog_controller.rb:37
|
51
|
+
msgid "Article was successfully created."
|
52
52
|
msgstr ""
|
53
53
|
|
54
|
-
#: app/
|
55
|
-
msgid "
|
54
|
+
#: app/controllers/blog_controller.rb:51
|
55
|
+
msgid "Article was successfully updated."
|
56
56
|
msgstr ""
|
57
57
|
|
58
|
-
#: app/views/blog/
|
59
|
-
msgid "
|
58
|
+
#: app/views/blog/new.rhtml:13 app/views/blog/list.rhtml:15
|
59
|
+
msgid "New article"
|
60
60
|
msgstr ""
|
61
61
|
|
62
|
-
#: app/views/blog/
|
63
|
-
msgid "
|
62
|
+
#: app/views/blog/new.rhtml:17
|
63
|
+
msgid "Create"
|
64
64
|
msgstr ""
|
65
65
|
|
66
|
-
#: app/views/blog/edit.rhtml:
|
67
|
-
|
66
|
+
#: app/views/blog/new.rhtml:20 app/views/blog/edit.rhtml:21
|
67
|
+
#: app/views/blog/show.rhtml:17
|
68
|
+
msgid "Back"
|
68
69
|
msgstr ""
|
69
70
|
|
70
|
-
#: app/views/blog/
|
71
|
-
|
72
|
-
msgid "Back"
|
71
|
+
#: app/views/blog/_form.rhtml:16
|
72
|
+
msgid "Lastupdate"
|
73
73
|
msgstr ""
|
74
74
|
|
75
|
-
#: app/views/blog/
|
76
|
-
|
77
|
-
msgid "GetText Sample Blog on RoR"
|
75
|
+
#: app/views/blog/_form.rhtml:18
|
76
|
+
msgid "Title: Required."
|
78
77
|
msgstr ""
|
79
78
|
|
80
|
-
#: app/views/blog/
|
81
|
-
msgid "
|
79
|
+
#: app/views/blog/_form.rhtml:21
|
80
|
+
msgid "Description: More than 10 characters."
|
81
|
+
msgstr ""
|
82
|
+
|
83
|
+
#: app/views/blog/list.rhtml:13 app/views/blog/show.rhtml:13
|
84
|
+
#: app/views/layouts/blog.rhtml:14
|
85
|
+
msgid "GetText Sample Blog on RoR"
|
82
86
|
msgstr ""
|
83
87
|
|
84
|
-
#: app/views/blog/list.rhtml:
|
88
|
+
#: app/views/blog/list.rhtml:18
|
85
89
|
msgid "No articles were found."
|
86
90
|
msgstr ""
|
87
91
|
|
88
|
-
#: app/views/blog/
|
89
|
-
msgid "
|
92
|
+
#: app/views/blog/edit.rhtml:12
|
93
|
+
msgid "Editing article"
|
94
|
+
msgstr ""
|
95
|
+
|
96
|
+
#: app/views/blog/edit.rhtml:16 app/views/blog/show.rhtml:16
|
97
|
+
msgid "Edit"
|
98
|
+
msgstr ""
|
99
|
+
|
100
|
+
#: app/views/blog/edit.rhtml:19
|
101
|
+
msgid "Show"
|
102
|
+
msgstr ""
|
103
|
+
|
104
|
+
#: app/views/blog/edit.rhtml:20
|
105
|
+
msgid "Destroy"
|
106
|
+
msgstr ""
|
107
|
+
|
108
|
+
#: app/views/blog/edit.rhtml:20
|
109
|
+
msgid "Are you sure?"
|
90
110
|
msgstr ""
|