hallelujah-gettext_activerecord 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/COPYING +55 -0
  2. data/ChangeLog +21 -0
  3. data/README.rdoc +175 -0
  4. data/Rakefile +120 -0
  5. data/lib/gettext_activerecord.rb +24 -0
  6. data/lib/gettext_activerecord/base.rb +73 -0
  7. data/lib/gettext_activerecord/i18n.rb +27 -0
  8. data/lib/gettext_activerecord/migration.rb +16 -0
  9. data/lib/gettext_activerecord/parser.rb +215 -0
  10. data/lib/gettext_activerecord/schema_definitions.rb +28 -0
  11. data/lib/gettext_activerecord/tools.rb +30 -0
  12. data/lib/gettext_activerecord/validations.rb +191 -0
  13. data/lib/gettext_activerecord/version.rb +12 -0
  14. data/po/bg/gettext_activerecord.po +115 -0
  15. data/po/bs/gettext_activerecord.po +125 -0
  16. data/po/ca/gettext_activerecord.po +116 -0
  17. data/po/cs/gettext_activerecord.po +124 -0
  18. data/po/de/gettext_activerecord.po +117 -0
  19. data/po/el/gettext_activerecord.po +115 -0
  20. data/po/eo/gettext_activerecord.po +116 -0
  21. data/po/es/gettext_activerecord.po +116 -0
  22. data/po/et/gettext_activerecord.po +116 -0
  23. data/po/fr/gettext_activerecord.po +118 -0
  24. data/po/gettext_activerecord.pot +113 -0
  25. data/po/hr/gettext_activerecord.po +125 -0
  26. data/po/hu/gettext_activerecord.po +116 -0
  27. data/po/it/gettext_activerecord.po +122 -0
  28. data/po/ja/gettext_activerecord.po +116 -0
  29. data/po/ko/gettext_activerecord.po +123 -0
  30. data/po/lv/gettext_activerecord.po +116 -0
  31. data/po/nb/gettext_activerecord.po +117 -0
  32. data/po/nl/gettext_activerecord.po +117 -0
  33. data/po/pt_BR/gettext_activerecord.po +117 -0
  34. data/po/ru/gettext_activerecord.po +117 -0
  35. data/po/sr/gettext_activerecord.po +117 -0
  36. data/po/ua/gettext_activerecord.po +120 -0
  37. data/po/vi/gettext_activerecord.po +116 -0
  38. data/po/zh/gettext_activerecord.po +119 -0
  39. data/po/zh_TW/gettext_activerecord.po +119 -0
  40. data/sample/README.rdoc +9 -0
  41. data/sample/Rakefile +32 -0
  42. data/sample/book.rb +3 -0
  43. data/sample/config/database.yml +3 -0
  44. data/sample/db/schema.rb +5 -0
  45. data/sample/po/ja/sample_ar.po +29 -0
  46. data/sample/po/sample_ar.pot +29 -0
  47. data/sample/sample.rb +22 -0
  48. metadata +119 -0
@@ -0,0 +1,119 @@
1
+ # translation of rails.po to Simplified Chinese
2
+ #
3
+ # a po-file for Ruby-GetText-Package and Ruby on Rails.
4
+ #
5
+ # Copyright (C) 2006-2008 Masao Mutoh
6
+ #
7
+ # This file is distributed under the same license as the Ruby-GetText-Package.
8
+ #
9
+ # Yang Bob <bob.yang.dev at gmail.com>, 2006-2008.
10
+ # Yingfeng <blogyingfeng at gmail.com>, 2006.
11
+ #
12
+ msgid ""
13
+ msgstr ""
14
+ "Project-Id-Version: gettext_activerecord 0.1.0\n"
15
+ "POT-Creation-Date: 2009-02-09 01:48+0900\n"
16
+ "PO-Revision-Date: 2006-04-15 13:36+0300\n"
17
+ "Last-Translator: Yang Bob <bob.yang.dev at gmail.com>\n"
18
+ "Language-Team: Simplified Chinese\n"
19
+ "MIME-Version: 1.0\n"
20
+ "Content-Type: text/plain; charset=UTF-8\n"
21
+ "Content-Transfer-Encoding: 8bit\n"
22
+ "Plural-Forms: nplurals=1; plural=0;\n"
23
+ "X-Generator: KBabel 1.9.1\n"
24
+
25
+ #: lib/gettext_activerecord/parser.rb:60
26
+ msgid "'%{file}' is not found."
27
+ msgstr ""
28
+
29
+ #: lib/gettext_activerecord/parser.rb:104
30
+ msgid "Ignored '%{file}'. Solve dependencies first."
31
+ msgstr ""
32
+
33
+ #: lib/gettext_activerecord/parser.rb:131
34
+ msgid "No database is available."
35
+ msgstr ""
36
+
37
+ #: lib/gettext_activerecord/parser.rb:167
38
+ msgid "rubygems are not found."
39
+ msgstr ""
40
+
41
+ #: lib/gettext_activerecord/active_record.rb:27
42
+ msgid "Validation failed: %{error_messages}"
43
+ msgstr "验证失败:%{error_messages}"
44
+
45
+ #: lib/gettext_activerecord/active_record.rb:218
46
+ msgid "%{attribute} is not included in the list"
47
+ msgstr "%{attribute}没有包含在本列表中"
48
+
49
+ #: lib/gettext_activerecord/active_record.rb:219
50
+ msgid "%{attribute} is reserved"
51
+ msgstr "%{attribute}是保留关键字"
52
+
53
+ #: lib/gettext_activerecord/active_record.rb:220
54
+ msgid "%{attribute} is invalid"
55
+ msgstr "%{attribute}无效"
56
+
57
+ #: lib/gettext_activerecord/active_record.rb:221
58
+ msgid "%{attribute} doesn't match confirmation"
59
+ msgstr "%{attribute}与确认输入的内容不一致"
60
+
61
+ #: lib/gettext_activerecord/active_record.rb:222
62
+ msgid "%{attribute} must be accepted"
63
+ msgstr "%{attribute}必须被接受"
64
+
65
+ #: lib/gettext_activerecord/active_record.rb:223
66
+ msgid "%{attribute} can't be empty"
67
+ msgstr "%{attribute}不能为空"
68
+
69
+ #: lib/gettext_activerecord/active_record.rb:224
70
+ msgid "%{attribute} can't be blank"
71
+ msgstr "%{attribute}不能为空"
72
+
73
+ #: lib/gettext_activerecord/active_record.rb:225
74
+ msgid "%{attribute} is too long (maximum is %{count} characters)"
75
+ msgstr "%{attribute}超出长度范围了(最多允许%{count}个字符)"
76
+
77
+ #: lib/gettext_activerecord/active_record.rb:226
78
+ msgid "%{attribute} is too short (minimum is %{count} characters)"
79
+ msgstr "%{attribute}太短了 (不能少于%{count}个字符)"
80
+
81
+ #: lib/gettext_activerecord/active_record.rb:227
82
+ msgid "%{attribute} is the wrong length (should be %{count} characters)"
83
+ msgstr "%{attribute}长度错误 (应当包含%{count}个字符)"
84
+
85
+ #: lib/gettext_activerecord/active_record.rb:228
86
+ msgid "%{attribute} has already been taken"
87
+ msgstr "%{attribute}已经被使用了"
88
+
89
+ #: lib/gettext_activerecord/active_record.rb:229
90
+ msgid "%{attribute} is not a number"
91
+ msgstr "%{attribute}不是数字"
92
+
93
+ #: lib/gettext_activerecord/active_record.rb:230
94
+ msgid "%{attribute} must be greater than %{count}"
95
+ msgstr "%{attribute}必须大于"
96
+
97
+ #: lib/gettext_activerecord/active_record.rb:231
98
+ msgid "%{attribute} must be greater than or equal to %{count}"
99
+ msgstr "%{attribute}必须大于等于"
100
+
101
+ #: lib/gettext_activerecord/active_record.rb:232
102
+ msgid "%{attribute} must be equal to %{count}"
103
+ msgstr "%{attribute}必须等于"
104
+
105
+ #: lib/gettext_activerecord/active_record.rb:233
106
+ msgid "%{attribute} must be less than %{count}"
107
+ msgstr "%{attribute}必须小于"
108
+
109
+ #: lib/gettext_activerecord/active_record.rb:234
110
+ msgid "%{attribute} must be less than or equal to %{count}"
111
+ msgstr "%{attribute}必须小于等于"
112
+
113
+ #: lib/gettext_activerecord/active_record.rb:235
114
+ msgid "%{attribute} must be odd"
115
+ msgstr "%{attribute}必须是奇数"
116
+
117
+ #: lib/gettext_activerecord/active_record.rb:236
118
+ msgid "%{attribute} must be even"
119
+ msgstr "%{attribute}必须是偶数"
@@ -0,0 +1,119 @@
1
+ #
2
+ # a po-file for Ruby-GetText-Package and Ruby on Rails.
3
+ #
4
+ # Copyright (C) 2005-2008 Masao Mutoh
5
+ #
6
+ # This file is distributed under the same license as the Ruby-GetText-Package.
7
+ #
8
+ # Yang Bob <bob.yang.dev at gmail.com>, 2006-2008.
9
+ # LIN CHUNG-YI <xmarsh at gmail.com>, 2006.
10
+ #
11
+ msgid ""
12
+ msgstr ""
13
+ "Project-Id-Version: gettext_activerecord 0.1.0\n"
14
+ "POT-Creation-Date: 2009-02-09 01:48+0900\n"
15
+ "PO-Revision-Date: 2006-08-21 09:27+0800\n"
16
+ "Last-Translator: Yang Bob <bob.yang.dev at gmail.com>\n"
17
+ "Language-Team: zh_TW <xmarsh at gmail.com>\n"
18
+ "MIME-Version: 1.0\n"
19
+ "Content-Type: text/plain; charset=UTF-8\n"
20
+ "Content-Transfer-Encoding: 8bit\n"
21
+ "X-Poedit-Language: Chinese\n"
22
+ "X-Poedit-Country: TAIWAN\n"
23
+ "Plural-Forms: nplurals=1; plural=0;\n"
24
+
25
+ #: lib/gettext_activerecord/parser.rb:60
26
+ msgid "'%{file}' is not found."
27
+ msgstr ""
28
+
29
+ #: lib/gettext_activerecord/parser.rb:104
30
+ msgid "Ignored '%{file}'. Solve dependencies first."
31
+ msgstr ""
32
+
33
+ #: lib/gettext_activerecord/parser.rb:131
34
+ msgid "No database is available."
35
+ msgstr ""
36
+
37
+ #: lib/gettext_activerecord/parser.rb:167
38
+ msgid "rubygems are not found."
39
+ msgstr ""
40
+
41
+ #: lib/gettext_activerecord/active_record.rb:27
42
+ msgid "Validation failed: %{error_messages}"
43
+ msgstr "校驗失敗:%{error_messages}"
44
+
45
+ #: lib/gettext_activerecord/active_record.rb:218
46
+ msgid "%{attribute} is not included in the list"
47
+ msgstr "%{attribute}沒有包含在列表中"
48
+
49
+ #: lib/gettext_activerecord/active_record.rb:219
50
+ msgid "%{attribute} is reserved"
51
+ msgstr "%{attribute}被保留"
52
+
53
+ #: lib/gettext_activerecord/active_record.rb:220
54
+ msgid "%{attribute} is invalid"
55
+ msgstr "%{attribute}是無效"
56
+
57
+ #: lib/gettext_activerecord/active_record.rb:221
58
+ msgid "%{attribute} doesn't match confirmation"
59
+ msgstr "%{attribute}不符和確認標準"
60
+
61
+ #: lib/gettext_activerecord/active_record.rb:222
62
+ msgid "%{attribute} must be accepted"
63
+ msgstr "%{attribute}必須接受"
64
+
65
+ #: lib/gettext_activerecord/active_record.rb:223
66
+ msgid "%{attribute} can't be empty"
67
+ msgstr "%{attribute}不能是空白"
68
+
69
+ #: lib/gettext_activerecord/active_record.rb:224
70
+ msgid "%{attribute} can't be blank"
71
+ msgstr "%{attribute}不能是空白"
72
+
73
+ #: lib/gettext_activerecord/active_record.rb:225
74
+ msgid "%{attribute} is too long (maximum is %{count} characters)"
75
+ msgstr "%{attribute}太長 (最長是%{count}个字)"
76
+
77
+ #: lib/gettext_activerecord/active_record.rb:226
78
+ msgid "%{attribute} is too short (minimum is %{count} characters)"
79
+ msgstr "%{attribute}太短 (最短是%{count}个字)"
80
+
81
+ #: lib/gettext_activerecord/active_record.rb:227
82
+ msgid "%{attribute} is the wrong length (should be %{count} characters)"
83
+ msgstr "%{attribute}字數錯誤 (應該是%{count}個字)"
84
+
85
+ #: lib/gettext_activerecord/active_record.rb:228
86
+ msgid "%{attribute} has already been taken"
87
+ msgstr "%{attribute}已被使用"
88
+
89
+ #: lib/gettext_activerecord/active_record.rb:229
90
+ msgid "%{attribute} is not a number"
91
+ msgstr "%{attribute}不是數字"
92
+
93
+ #: lib/gettext_activerecord/active_record.rb:230
94
+ msgid "%{attribute} must be greater than %{count}"
95
+ msgstr "%{attribute}必須大於"
96
+
97
+ #: lib/gettext_activerecord/active_record.rb:231
98
+ msgid "%{attribute} must be greater than or equal to %{count}"
99
+ msgstr "%{attribute}必須大於等於"
100
+
101
+ #: lib/gettext_activerecord/active_record.rb:232
102
+ msgid "%{attribute} must be equal to %{count}"
103
+ msgstr "%{attribute}必須等於"
104
+
105
+ #: lib/gettext_activerecord/active_record.rb:233
106
+ msgid "%{attribute} must be less than %{count}"
107
+ msgstr "%{attribute}必須小於"
108
+
109
+ #: lib/gettext_activerecord/active_record.rb:234
110
+ msgid "%{attribute} must be less than or equal to %{count}"
111
+ msgstr "%{attribute}必須小於等於"
112
+
113
+ #: lib/gettext_activerecord/active_record.rb:235
114
+ msgid "%{attribute} must be odd"
115
+ msgstr "%{attribute}必須是奇数"
116
+
117
+ #: lib/gettext_activerecord/active_record.rb:236
118
+ msgid "%{attribute} must be even"
119
+ msgstr "%{attribute}必須是偶数"
@@ -0,0 +1,9 @@
1
+ = Sample for gettext_activerecord
2
+ == USAGE
3
+ (Install sqlite3 and sqlite3-ruby first)
4
+
5
+ $ Edit config/database.yml if you need.
6
+ $ rake createdb
7
+ $ rake makemo
8
+ $ ruby sample.rb
9
+ (or ruby -I/gettext/path/lib sample.rb)
@@ -0,0 +1,32 @@
1
+ $LOAD_PATH.unshift "../lib"
2
+
3
+ gettext_path = File.join(ENV["GETTEXT_PATH"] || "../../gettext/", "lib")
4
+ $LOAD_PATH.unshift gettext_path
5
+
6
+ require 'rubygems'
7
+ require 'gettext'
8
+
9
+ desc "Create mo files"
10
+ task :makemo do
11
+ require 'gettext_activerecord/tools'
12
+ GetText.create_mofiles
13
+ end
14
+
15
+ desc "Update po files"
16
+ task :updatepo do
17
+ require 'gettext_activerecord/tools'
18
+ # Read Database information from "config/database.yml"
19
+ GetText.update_pofiles("sample_ar", ["book.rb"],
20
+ "sample AR 1.0.0")
21
+ end
22
+
23
+ task :createdb do
24
+ require 'active_record'
25
+ config = YAML.load(IO.read("config/database.yml"))["development"]
26
+ ActiveRecord::Base.establish_connection(config)
27
+ require 'db/schema.rb'
28
+ end
29
+
30
+ task :dropdb do
31
+ rm "db/development.sqlite3"
32
+ end
@@ -0,0 +1,3 @@
1
+ class Book < ActiveRecord::Base
2
+ validates_length_of :title, :minimum => 10
3
+ end
@@ -0,0 +1,3 @@
1
+ development:
2
+ adapter: "sqlite3"
3
+ database: db/development.sqlite3
@@ -0,0 +1,5 @@
1
+ ActiveRecord::Schema.define(:version => 1) do
2
+ create_table :books do |t|
3
+ t.string :title, :author_name
4
+ end
5
+ end
@@ -0,0 +1,29 @@
1
+ # Japanese translations for PACKAGE package
2
+ # PACKAGE パッケージに対する英訳.
3
+ # Copyright (C) 2009 THE PACKAGE'S COPYRIGHT HOLDER
4
+ # This file is distributed under the same license as the PACKAGE package.
5
+ # Masao Mutoh <mutoh@sowhat.com>, 2009.
6
+ #
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: sample AR 1.0.0\n"
10
+ "POT-Creation-Date: 2009-02-28 02:12+0900\n"
11
+ "PO-Revision-Date: 2009-02-15 22:42+0900\n"
12
+ "Last-Translator: Masao Mutoh <mutoh@sowhat.com>\n"
13
+ "Language-Team: Japanese\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+
19
+ #: book.rb:-
20
+ msgid "book"
21
+ msgstr "書籍"
22
+
23
+ #: book.rb:-
24
+ msgid "Book|Title"
25
+ msgstr "タイトル"
26
+
27
+ #: book.rb:-
28
+ msgid "Book|Author name"
29
+ msgstr "著者"
@@ -0,0 +1,29 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the PACKAGE package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: sample AR 1.0.0\n"
10
+ "POT-Creation-Date: 2009-02-28 02:12+0900\n"
11
+ "PO-Revision-Date: 2009-02-15 22:33+0900\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
18
+
19
+ #: book.rb:-
20
+ msgid "book"
21
+ msgstr ""
22
+
23
+ #: book.rb:-
24
+ msgid "Book|Title"
25
+ msgstr ""
26
+
27
+ #: book.rb:-
28
+ msgid "Book|Author name"
29
+ msgstr ""
@@ -0,0 +1,22 @@
1
+ $LOAD_PATH.unshift "../lib"
2
+
3
+ require 'rubygems'
4
+ require 'gettext'
5
+ require 'gettext_activerecord'
6
+ require 'yaml'
7
+
8
+ require 'book'
9
+
10
+ config = YAML.load(IO.read("config/database.yml"))["development"]
11
+ ActiveRecord::Base.establish_connection(config)
12
+
13
+ GetText.bindtextdomain_to(ActiveRecord, "sample_ar", :path => "locale")
14
+
15
+ GetText.set_locale "ja_JP.UTF-8"
16
+ book = Book.new
17
+ book.title = "Foo"
18
+ book.save
19
+ puts book.errors.full_messages #puts Japanese error message.
20
+
21
+ GetText.set_locale "en"
22
+ puts book.errors.full_messages #puts English error message.
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hallelujah-gettext_activerecord
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.4
5
+ platform: ruby
6
+ authors:
7
+ - Masao Mutoh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-20 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: gettext
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.0.4
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: activerecord
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.3.2
34
+ version:
35
+ description: Localization support for ActiveRecord by Ruby-GetText-Package.
36
+ email: mutomasa at gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - ChangeLog
45
+ - po/hr/gettext_activerecord.po
46
+ - po/cs/gettext_activerecord.po
47
+ - po/vi/gettext_activerecord.po
48
+ - po/nb/gettext_activerecord.po
49
+ - po/nl/gettext_activerecord.po
50
+ - po/zh/gettext_activerecord.po
51
+ - po/el/gettext_activerecord.po
52
+ - po/ko/gettext_activerecord.po
53
+ - po/gettext_activerecord.pot
54
+ - po/de/gettext_activerecord.po
55
+ - po/lv/gettext_activerecord.po
56
+ - po/hu/gettext_activerecord.po
57
+ - po/ja/gettext_activerecord.po
58
+ - po/eo/gettext_activerecord.po
59
+ - po/sr/gettext_activerecord.po
60
+ - po/es/gettext_activerecord.po
61
+ - po/bg/gettext_activerecord.po
62
+ - po/ca/gettext_activerecord.po
63
+ - po/bs/gettext_activerecord.po
64
+ - po/it/gettext_activerecord.po
65
+ - po/pt_BR/gettext_activerecord.po
66
+ - po/ua/gettext_activerecord.po
67
+ - po/ru/gettext_activerecord.po
68
+ - po/zh_TW/gettext_activerecord.po
69
+ - po/fr/gettext_activerecord.po
70
+ - po/et/gettext_activerecord.po
71
+ - sample/po/ja/sample_ar.po
72
+ - sample/po/sample_ar.pot
73
+ - sample/README.rdoc
74
+ - sample/Rakefile
75
+ - sample/sample.rb
76
+ - sample/config/database.yml
77
+ - sample/db/schema.rb
78
+ - sample/book.rb
79
+ - README.rdoc
80
+ - COPYING
81
+ - Rakefile
82
+ - lib/gettext_activerecord.rb
83
+ - lib/gettext_activerecord/migration.rb
84
+ - lib/gettext_activerecord/i18n.rb
85
+ - lib/gettext_activerecord/validations.rb
86
+ - lib/gettext_activerecord/schema_definitions.rb
87
+ - lib/gettext_activerecord/parser.rb
88
+ - lib/gettext_activerecord/version.rb
89
+ - lib/gettext_activerecord/base.rb
90
+ - lib/gettext_activerecord/tools.rb
91
+ has_rdoc: false
92
+ homepage: http://gettext.rubyforge.org/
93
+ licenses:
94
+ post_install_message:
95
+ rdoc_options: []
96
+
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: "0"
104
+ version:
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: "0"
110
+ version:
111
+ requirements: []
112
+
113
+ rubyforge_project: gettext
114
+ rubygems_version: 1.3.5
115
+ signing_key:
116
+ specification_version: 3
117
+ summary: Localization support for ActiveRecord by Ruby-GetText-Package.
118
+ test_files: []
119
+