gettext 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. data/ChangeLog +128 -0
  2. data/NEWS +10 -0
  3. data/README +21 -23
  4. data/Rakefile +39 -20
  5. data/bin/rgettext +1 -1
  6. data/bin/rmsgfmt +1 -1
  7. data/bin/rmsgmerge +1 -1
  8. data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
  9. data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
  10. data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
  11. data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
  12. data/data/locale/el/LC_MESSAGES/rails.mo +0 -0
  13. data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
  14. data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
  15. data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
  16. data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
  17. data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
  18. data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
  19. data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
  20. data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
  21. data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
  22. data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
  23. data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
  24. data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
  25. data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
  26. data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
  27. data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
  28. data/ext/gettext/extconf.rb +20 -0
  29. data/ext/gettext/{gettext/_locale.c → locale_system.c} +15 -19
  30. data/lib/gettext.rb +186 -38
  31. data/lib/gettext/cgi.rb +35 -69
  32. data/lib/gettext/container.rb +14 -5
  33. data/lib/gettext/erb.rb +30 -2
  34. data/lib/gettext/iconv.rb +19 -4
  35. data/lib/gettext/locale.rb +188 -39
  36. data/lib/gettext/locale_cgi.rb +102 -0
  37. data/lib/gettext/locale_object.rb +131 -0
  38. data/lib/gettext/locale_posix.rb +50 -0
  39. data/lib/gettext/locale_table_win32.rb +224 -182
  40. data/lib/gettext/locale_win32.rb +59 -35
  41. data/lib/gettext/mo.rb +2 -2
  42. data/lib/gettext/parser/activerecord.rb +19 -5
  43. data/lib/gettext/parser/erb.rb +6 -3
  44. data/lib/gettext/parser/glade.rb +5 -5
  45. data/lib/gettext/parser/ruby.rb +6 -6
  46. data/lib/gettext/poparser.rb +7 -6
  47. data/lib/gettext/rails.rb +122 -44
  48. data/lib/gettext/rgettext.rb +21 -8
  49. data/lib/gettext/rmsgfmt.rb +16 -8
  50. data/lib/gettext/rmsgmerge.rb +172 -50
  51. data/lib/gettext/string.rb +25 -3
  52. data/lib/gettext/textdomain.rb +89 -90
  53. data/lib/gettext/utils.rb +63 -3
  54. data/lib/gettext/version.rb +2 -2
  55. data/pkg/ruby-gettext-package-1.2.0/ext/gettext/extconf.rb +20 -0
  56. data/po/cs/rails.po +28 -28
  57. data/po/cs/rgettext.po +14 -14
  58. data/po/de/rails.po +29 -26
  59. data/po/de/rgettext.po +24 -17
  60. data/po/el/rails.po +26 -26
  61. data/po/el/rgettext.po +18 -15
  62. data/po/es/rails.po +26 -26
  63. data/po/es/rgettext.po +16 -16
  64. data/po/fr/rails.po +27 -27
  65. data/po/fr/rgettext.po +14 -14
  66. data/po/it/rgettext.po +14 -14
  67. data/po/ja/rails.po +24 -24
  68. data/po/ja/rgettext.po +14 -14
  69. data/po/ko/rails.po +24 -24
  70. data/po/ko/rgettext.po +17 -18
  71. data/po/nl/rails.po +27 -27
  72. data/po/nl/rgettext.po +18 -18
  73. data/po/pt_BR/rails.po +26 -26
  74. data/po/pt_BR/rgettext.po +14 -14
  75. data/po/rails.pot +26 -26
  76. data/po/rgettext.pot +14 -14
  77. data/po/sv/rgettext.po +14 -14
  78. data/post-setup.rb +8 -3
  79. data/pre-setup.rb +14 -1
  80. data/samples/cgi/http.rb +2 -1
  81. data/samples/makemo.rb +1 -1
  82. data/samples/rails/app/models/article.rb +15 -1
  83. data/samples/rails/locale/cs/LC_MESSAGES/blog.mo +0 -0
  84. data/samples/rails/locale/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
  85. data/samples/rails/locale/de/LC_MESSAGES/blog.mo +0 -0
  86. data/samples/rails/locale/de/LC_MESSAGES/gettext_plugin.mo +0 -0
  87. data/samples/rails/locale/el/LC_MESSAGES/blog.mo +0 -0
  88. data/samples/rails/locale/el/LC_MESSAGES/gettext_plugin.mo +0 -0
  89. data/samples/rails/locale/en/LC_MESSAGES/blog.mo +0 -0
  90. data/samples/rails/locale/es/LC_MESSAGES/blog.mo +0 -0
  91. data/samples/rails/locale/es/LC_MESSAGES/gettext_plugin.mo +0 -0
  92. data/samples/rails/locale/fr/LC_MESSAGES/blog.mo +0 -0
  93. data/samples/rails/locale/fr/LC_MESSAGES/gettext_plugin.mo +0 -0
  94. data/samples/rails/locale/ja/LC_MESSAGES/blog.mo +0 -0
  95. data/samples/rails/locale/ja/LC_MESSAGES/gettext_plugin.mo +0 -0
  96. data/samples/rails/locale/ko/LC_MESSAGES/blog.mo +0 -0
  97. data/samples/rails/locale/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
  98. data/samples/rails/locale/nl/LC_MESSAGES/blog.mo +0 -0
  99. data/samples/rails/locale/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
  100. data/samples/rails/locale/pt_BR/LC_MESSAGES/blog.mo +0 -0
  101. data/samples/rails/locale/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
  102. data/samples/rails/po/blog.pot +1 -1
  103. data/samples/rails/po/cs/blog.po +1 -2
  104. data/samples/rails/po/cs/gettext_plugin.po +1 -1
  105. data/samples/rails/po/de/blog.po +1 -2
  106. data/samples/rails/po/de/gettext_plugin.po +1 -1
  107. data/samples/rails/po/el/blog.po +1 -1
  108. data/samples/rails/po/el/gettext_plugin.po +1 -1
  109. data/samples/rails/po/en/blog.po +1 -1
  110. data/samples/rails/po/es/blog.po +1 -2
  111. data/samples/rails/po/es/gettext_plugin.po +1 -1
  112. data/samples/rails/po/fr/blog.po +1 -1
  113. data/samples/rails/po/fr/gettext_plugin.po +1 -1
  114. data/samples/rails/po/gettext_plugin.pot +1 -1
  115. data/samples/rails/po/ja/blog.po +2 -1
  116. data/samples/rails/po/ja/gettext_plugin.po +1 -1
  117. data/samples/rails/po/ko/blog.po +1 -2
  118. data/samples/rails/po/ko/gettext_plugin.po +1 -1
  119. data/samples/rails/po/nl/blog.po +1 -3
  120. data/samples/rails/po/nl/gettext_plugin.po +1 -1
  121. data/samples/rails/po/pt_BR/blog.po +1 -1
  122. data/samples/rails/po/pt_BR/gettext_plugin.po +1 -1
  123. data/setup.rb +799 -574
  124. data/src/poparser.ry +6 -5
  125. data/test/gettext_runner.rb +3 -1
  126. data/test/gettext_test.rb +40 -24
  127. data/test/gettext_test_cgi.rb +60 -6
  128. data/test/gettext_test_locale.rb +136 -0
  129. data/test/gettext_test_parser.rb +12 -12
  130. data/test/locale/la/LC_MESSAGES/plural_error.mo +0 -0
  131. data/test/po/la/plural_error.po +21 -0
  132. data/test/test.bat +2 -0
  133. data/test/test.sh +2 -4
  134. data/test/{test_rubyparser_n.rb → test_rubyparser_n_.rb} +0 -0
  135. metadata +17 -12
  136. data/ext/gettext/gettext/MANIFEST +0 -3
  137. data/ext/gettext/gettext/extconf.rb +0 -20
  138. data/lib/gettext/locale_default.rb +0 -35
data/ChangeLog CHANGED
@@ -1,3 +1,131 @@
1
+ 2006-02-23 Masao Mutoh <mutoh@highway.ne.jp>
2
+
3
+ * Rakefile: Fix a problem to make package on Win32.
4
+ * lib/gettext/textdomain.rb: Rename @mo to @current_mo
5
+ and add a attr_reader for @current_mo.
6
+ * README, NEWS: updated.
7
+ * lib/gettext/rails.rb: Fix to translate error message
8
+ title/explanation.
9
+ * lib/gettext/parser/activerecord.rb: Fix an abort when
10
+ config/database.xml is not defined.
11
+
12
+ 2006-02-22 Masao Mutoh <mutoh@highway.ne.jp>
13
+
14
+ * lib/gettext/rmsgfmt.rb, string.rb, iconv.rb, utils.rb, rgettext.rb,
15
+ lib/gettext/parser/*.rb: Apply RDoc.
16
+ * lib/gettext/version.rb: Increment minor version.
17
+
18
+ 2006-02-21 Masao Mutoh <mutoh@highway.ne.jp>
19
+
20
+ * test/test.bat: Added for Win32.
21
+ * test/gettext_test_locale.rb: Added Win32 tests.
22
+ * lib/gettext/locale_win32.rb: Fix problems.
23
+ * lib/gettext/locale_object.rb: Added Locale::Object#to_win
24
+
25
+ 2006-02-20 Masao Mutoh <mutoh@highway.ne.jp>
26
+
27
+ * src/poparser.ry: Added ignore_fuzzy as the 3rd parameter
28
+ of GetText::PoParser#parse to parse fuzzy comments.
29
+ Pointed out by speakillof.
30
+ * lib/gettext/rmsgmerge.rb: Follow the PoParser change below.
31
+ * test/gettext_test_locale.rb: Apply Locale.clear.
32
+ * lib/gettext/locale.rb: Added Locale.clear.
33
+
34
+ 2006-02-18 Masao Mutoh <mutoh@highway.ne.jp>
35
+
36
+ * lib/gettext/locale_cgi.rb: Separate from cgi.rb.
37
+ * lib/gettext/locale_posix.rb: Rename from locale_default.rb.
38
+
39
+ 2006-02-16 Masao Mutoh <mutoh@highway.ne.jp>
40
+
41
+ * lib/gettext/textdomain.rb: Add comments.
42
+ * lib/gettext.rb: Apply Locale::Object. Code cleanup. Add RDoc.
43
+ * test/gettext_test.rb: Apply gettext.rb changes
44
+ * test/test.sh: Remove OUTPUT_CHARSET setting.
45
+
46
+ 2006-02-15 Masao Mutoh <mutoh@highway.ne.jp>
47
+
48
+ * lib/gettext/locale_win32.rb, locale_default.rb, locale.rb: A first argument
49
+ of Locale::System.get_charset becomes Locale::Object.
50
+ * lib/gettext/textdomain.rb: Apply Locale::Object, Code cleanup.
51
+ * lib/gettext.rb: Add GetText.add_default_locale_path.
52
+ * lib/gettext/locale_object.rb: Add Locale::Object#==.
53
+ * lib/gettext/textdomain.rb: Add GetText::TextDomain.add_default_locale_path.
54
+ Pointed out at Bug#3510.
55
+
56
+ 2006-02-14 Masao Mutoh <mutoh@highway.ne.jp>
57
+
58
+ * Rakefile: Fix compilation problems on mswin32.
59
+ * ext/gettext/locale_system.c: locale_id returns language ID not LCID.
60
+
61
+ 2006-02-13 Masao Mutoh <mutoh@highway.ne.jp>
62
+
63
+ * lib/gettext/locale_table_win32.rb: Replace the table and add charset info.
64
+ * lib/gettext/locale_win32.rb: ditto.
65
+
66
+ 2006-02-10 Masao Mutoh <mutoh@highway.ne.jp>
67
+
68
+ * lib/gettext/locale_object.rb: Add script, sort_order properties.
69
+
70
+ 2006-02-09 Masao Mutoh <mutoh@highway.ne.jp>
71
+
72
+ * test/gettext_test_locale.rb: Added modifier test.
73
+ * lib/gettext/locale_object.rb: Added to parse modifier.
74
+ * lib/gettext/locale.rb: Fixed bug of Locale#set_current.
75
+ * test/gettext_test_cgi.rb: Added tests.
76
+ * lib/gettext/cgi.rb: Apply RDoc.
77
+ * lib/gettext/locale_default.rb, locale.rb: Modify RDoc.
78
+ * lib/gettext/locale_win32.rb: Imprement pseudo Locale::System.get_charset().
79
+
80
+ 2006-02-07 Masao Mutoh <mutoh@highway.ne.jp>
81
+
82
+ * test/gettext_test_locale.rb: Added for new Locale.
83
+ * lib/gettext/locale.rb: Refactored. Follow to support Locale::Object.
84
+ Add Locale.set_default, .default=, .system, .default, .current,
85
+ .set_current, .current=, .current_charset. Reimplemented .get/.set.
86
+ Locale.set(loctype, localestr) is deprecated. Use Locale.set(localestr) instead.
87
+ Locale.setlocale(loctype, localestr) is deprecated. Use Locale.set(localestr) instead.
88
+ Locale.get(loctype) is deprecated. Use Locale.get instead.
89
+
90
+ 2006-02-05 Masao Mutoh <mutoh@highway.ne.jp>
91
+
92
+ * test/test_rubyparser_n_.rb: Rename from test/test_rubyparser_n.rb.
93
+ This has a problem on Windows with test/test_rubyparser_N.rb.
94
+
95
+ 2006-02-04 Masao Mutoh <mutoh@highway.ne.jp>
96
+
97
+ * pre-setup.rb: Remove previous installed files first.
98
+ * ext/gettext/gettext: Removed.
99
+ * ext/gettext/locale_system.c: Added as Accessor to system(win32/posix).
100
+ (Move from ext/gettext/gettext/_locale.c)
101
+ * ext/gettext/extconf.rb: ditto.
102
+ * lib/gettext/locale_default.rb: Follow above changes. Apply RDoc.
103
+ * lib/gettext/locale_win32.rb: Follow above changes. Apply RDoc.
104
+ * lib/gettext/locale.rb: Code cleanup. Apply RDoc.
105
+ * lib/gettext/locale_object.rb: Added Locale::Object. Apply RDoc.
106
+ * setup.rb: Update to 3.4.1.
107
+
108
+ 2006-01-25 Masao Mutoh <mutoh@highway.ne.jp>
109
+
110
+ * lib/gettext/rmsgmerge.rb: Fixed bugs.
111
+ Follow the comment messages to GNU GetText. By speakillof.
112
+
113
+ 2006-01-20 Masao Mutoh <mutoh@highway.ne.jp>
114
+
115
+ * lib/gettext/rails.rb: Added ActiveRecord::Base#error_message_(title|explanation).
116
+ Reimplement ActionView::Helpers::ActiveRecordHelper::L10n.error_messages_for to
117
+ separate error_message_(title|explanation) to be able to be overrided by user.
118
+ The idea is from Trung Tran.
119
+ * samples/rails/app/models/article.rb: Add a sample of
120
+ ActiveRecord::Base#error_message_(title|explanation).
121
+
122
+ 2006-01-19 Masao Mutoh <mutoh@highway.ne.jp>
123
+
124
+ * lib/gettext.rb: n_() accepts first arguments as an Array([msgid, msgid_plural]).
125
+ * test/gettext_test.rb: Add tests for n_(ary, n), Nn_().
126
+ * lib/gettext/parser/ruby.rb: Added Nn_() is same purpose with N_, but for n_.
127
+ * lib/gettext.rb: Added Nn_(msgid, msgid_plural).
128
+
1
129
  2006-01-14 Masao Mutoh <mutoh@highway.ne.jp>
2
130
 
3
131
  * samples/rails/po/*/blog.po: Updated.
data/NEWS CHANGED
@@ -1,3 +1,13 @@
1
+ = Ruby-GetText-Package-1.2.0 (2006-02-23)
2
+
3
+ * Re-implement Locale module and Implements Locale::Object,
4
+ Locale::System, etc.
5
+ * Fix bugs.
6
+ * Apply RDoc (not complete)
7
+ * Improve to support Ruby on Rails.
8
+ * Add GetText.Nn_.
9
+ * Add rmsgmerge (Experimental)
10
+
1
11
  = Ruby-GetText-Package-1.1.1 (2006-01-14)
2
12
 
3
13
  * Bugfixes.
data/README CHANGED
@@ -4,8 +4,12 @@ Ruby-Gettext-Package
4
4
  Ruby-GetText-Package is a Localization(L10n) library and tools
5
5
  which modeled after GNU gettext package.
6
6
 
7
- It converts the messages to localized messages properly using
8
- client-side locale information(environment variable or CGI variable).
7
+ This library provides to translate original messages to localized
8
+ messages properly using client-side locale information(environment
9
+ variable or CGI variable).
10
+
11
+ And the tools for developers support to create, use, and modify
12
+ localized message files(message catalogs) easily.
9
13
 
10
14
  Features:
11
15
 
@@ -36,7 +40,9 @@ Ruby-Gettext-Package
36
40
  Requirements
37
41
  ------------
38
42
 
39
- * Ruby 1.8.2 or later <http://www.ruby-lang.org/ja/>
43
+ * Ruby 1.8.3 or later <http://www.ruby-lang.org/ja/>
44
+
45
+ (options)
40
46
  * GNU gettext 0.10.35 or later
41
47
  <http://www.gnu.org/software/gettext/gettext.html>
42
48
  (for Development only)
@@ -66,18 +72,13 @@ Usage
66
72
 
67
73
  If you are developer of the application which depends on this library,
68
74
  see:
69
- http://gettext.rubyforge.org/ (English)
70
- http://gettext.rubyforge.org/ja/ (Japanese)
71
-
75
+ http://gettext.rubyforge.org/
72
76
 
73
77
  License
74
78
  -------
75
79
  This program is licenced under the same licence as Ruby.
76
80
  (See the file 'COPYING'.)
77
81
 
78
- * Ruby-GetText-Package
79
- Copyright (C) 2001-2006 Masao Mutoh <mutoh@highwhay.ne.jp>
80
-
81
82
  * mo.rb
82
83
  Copyright (C) 2001-2004 Masao Mutoh <mutoh@highwhay.ne.jp>
83
84
  Copyright (C) 2001,2002 Masahiro Sakai <s01397ms@sfc.keio.ac.jp>
@@ -90,11 +91,8 @@ License
90
91
  Copyright (C) 2001-2005 Masao Mutoh <mutoh@highwhay.ne.jp>
91
92
  Copyright (C) 2001,2002 Yasushi Shoji <yashi@yashi.com>
92
93
 
93
- * rmsgfmt
94
- Copyright (C) 2003,2005 Masao Mutoh <mutoh@highwhay.ne.jp>
95
-
96
94
  * setup.rb
97
- Copyright (C) 2000-2004 Minero Aoki <aamine@loveruby.net>
95
+ Copyright (C) 2000-2005 Minero Aoki <aamine@loveruby.net>
98
96
  This file is released under LGPL. See the top of the install.rb.
99
97
 
100
98
  * Others
@@ -120,18 +118,18 @@ Swedish - Nikolai Weibull <mailing-lists.ruby-talk at rawuncut.elitem
120
118
 
121
119
  Status of translations
122
120
  ----------------------
123
- cs - 1.1.1
124
- fr - 1.1.1
125
- de - 1.1.1
126
- el - 1.1.1
127
- es - 1.1.1
121
+ cs - 1.2.0
122
+ fr - 1.2.0
123
+ de - 1.2.0
124
+ el - 1.2.0
125
+ es - 1.2.0
128
126
  it - 1.0.0
129
- ja - 1.1.1
130
- ko - 1.1.1
131
- nl - 1.1.1
132
- pt_BR - 1.1.1
127
+ ja - 1.2.0
128
+ ko - 1.2.0
129
+ nl - 1.2.0
130
+ pt_BR - 1.2.0
133
131
  sv - 0.8.0
134
132
 
135
133
  Maintainer
136
134
  ----------
137
- Masao Mutoh<mutoh@highway.ne.jp>
135
+ Masao Mutoh <mutoh@highway.ne.jp>
data/Rakefile CHANGED
@@ -11,6 +11,7 @@
11
11
  #
12
12
 
13
13
  $:.unshift "./lib"
14
+ $:.unshift "./ext/gettext"
14
15
 
15
16
  require 'rubygems'
16
17
  require 'rake'
@@ -57,16 +58,24 @@ EOS
57
58
  file.close
58
59
  tmpfile.close
59
60
  File.delete("src/poparser.tmp.rb")
60
- $stderr.puts "Create #{poparser_path}."
61
+ $stderr.puts "Create #{poparser_path}."
62
+ require 'gettext/utils'
61
63
  end
62
64
  end
63
65
 
64
66
  ############################################################
65
67
  # Manage po/mo files
66
68
  ############################################################
67
- require 'gettext/utils'
69
+ begin
70
+ require 'gettext'
71
+ require 'gettext/poparser'
72
+ require 'gettext/utils'
73
+ rescue LoadError
74
+ puts "gettext/poparser was not found."
75
+ end
68
76
 
69
77
  task :makemo_test do
78
+ require 'gettext/utils'
70
79
  $stderr.puts "Create test mo files."
71
80
  GetText.create_mofiles(false, "test/po", "test/locale")
72
81
  end
@@ -126,27 +135,38 @@ end
126
135
  ############################################################
127
136
  # Package tasks
128
137
  ############################################################
138
+
139
+ if /mswin32/ =~ RUBY_PLATFORM
140
+ task :gem => [:mswin32so]
141
+ task :mswin32so do
142
+ FileUtils.cd 'ext/gettext' do
143
+ system "#{RUBYBIN} extconf.rb"
144
+ system "nmake"
145
+ FileUtils.cp 'locale_system.so', '../../lib/'
146
+ end
147
+ end
148
+ end
149
+
129
150
  desc "Create gem and tar.gz"
130
151
  spec = Gem::Specification.new do |s|
131
152
  s.name = 'gettext'
132
153
  s.version = PKG_VERSION
133
- if /mswin32/ =~ RUBY_PLATFORM
134
- s.platform = Gem::Platform::WIN32
135
- FileUtils.cd 'ext/gettext/gettext/' do
136
- system "#{RUBYBIN} extconf.rb"
137
- system "nmake"
138
- FileUtils.cp '_locale.so', '../../../lib/'
154
+
155
+ if /mswin32|mingw/ =~ RUBY_PLATFORM
156
+ s.platform = Gem::Platform::WIN32
157
+ else
158
+ s.extensions << "ext/gettext/extconf.rb"
159
+ s.extensions.concat Dir.glob('**/extconf.rb')
139
160
  end
140
- else
141
- s.extensions << "ext/gettext/gettext/extconf.rb"
142
- s.extensions.concat Dir.glob('**/extconf.rb')
143
- end
144
- s.summary = 'Ruby-GetText-Package is Native Language Support Library and Tools which modeled after GNU gettext package.'
161
+
162
+ s.summary = 'Ruby-GetText-Package is a libary and tools to localize messages.'
145
163
  s.author = 'Masao Mutoh'
146
164
  s.email = 'mutoh@highway.ne.jp'
147
- s.homepage = 'http://ponx.s5.xrea.com/hiki/ruby-gettext.html'
165
+ s.homepage = 'http://www.yotabanana.com/hiki/ruby-gettext.html'
148
166
  s.rubyforge_project = "gettext"
149
- s.files = FileList['**/*'].to_a.select{|v| v !~ /pkg|CVS/}
167
+ files = FileList['**/*'].to_a.select{|v| v !~ /pkg|CVS/}
168
+ files << "lib/locale_system.so" if /mswin32/ =~ RUBY_PLATFORM
169
+ s.files = files
150
170
  s.require_path = 'lib'
151
171
  s.executables = Dir.entries('bin').delete_if {|item| /^\.|CVS|~$/ =~ item }
152
172
  s.bindir = 'bin'
@@ -158,10 +178,10 @@ end
158
178
  end
159
179
 
160
180
  unless /mswin32/ =~ RUBY_PLATFORM
161
- Rake::PackageTask.new("ruby-gettext-package", PKG_VERSION) do |p|
162
- p.package_files = FileList['**/*'].to_a.select{|v| v !~ /pkg|CVS/}
163
- p.need_tar_gz = true
164
- p.need_zip = false
181
+ Rake::PackageTask.new("ruby-gettext-package", PKG_VERSION) do |o|
182
+ o.package_files = FileList['**/*'].to_a.select{|v| v !~ /pkg|CVS/}
183
+ o.need_tar_gz = true
184
+ o.need_zip = false
165
185
  end
166
186
  end
167
187
 
@@ -171,7 +191,6 @@ Rake::GemPackageTask.new(spec) do |p|
171
191
  p.need_zip = false
172
192
  end
173
193
 
174
-
175
194
  ############################################################
176
195
  # Misc tasks
177
196
  ############################################################
data/bin/rgettext CHANGED
@@ -7,7 +7,7 @@
7
7
  You may redistribute it and/or modify it under the same
8
8
  license terms as Ruby.
9
9
 
10
- $Id: rgettext,v 1.4 2005/11/27 15:35:54 mutoh Exp $
10
+ $Id: rgettext,v 1.8 2006/02/22 16:42:41 mutoh Exp $
11
11
  =end
12
12
 
13
13
  begin
data/bin/rmsgfmt CHANGED
@@ -7,7 +7,7 @@
7
7
  You may redistribute it and/or modify it under the same
8
8
  license terms as Ruby.
9
9
 
10
- $Id: rmsgfmt,v 1.3 2005/11/27 15:35:54 mutoh Exp $
10
+ $Id: rmsgfmt,v 1.7 2006/02/22 16:42:41 mutoh Exp $
11
11
  =end
12
12
 
13
13
  begin
data/bin/rmsgmerge CHANGED
@@ -7,7 +7,7 @@
7
7
  You may redistribute it and/or modify it under the same
8
8
  license terms as Ruby.
9
9
 
10
- $Id: rmsgmerge,v 1.2 2005/11/27 15:35:54 mutoh Exp $
10
+ $Id: rmsgmerge,v 1.6 2006/02/22 16:42:41 mutoh Exp $
11
11
  =end
12
12
 
13
13
  begin
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
Binary file
Binary file
@@ -0,0 +1,20 @@
1
+ =begin
2
+ extconf.rb
3
+
4
+ Copyright (C) 2002-2006 Masao Mutoh <mutoh@highway.ne.jp>
5
+
6
+ You may redistribute it and/or modify it under the same
7
+ license terms as Ruby.
8
+
9
+ $Id: extconf.rb,v 1.1 2006/02/07 00:24:45 mutoh Exp $
10
+ =end
11
+
12
+ require 'mkmf'
13
+
14
+ if RUBY_PLATFORM =~ /cygwin|mingw|mswin32|bccwin32/
15
+ have_header 'windows.h'
16
+ else
17
+ have_func 'setlocale'
18
+ have_func 'nl_langinfo'
19
+ end
20
+ create_makefile 'locale_system'
@@ -1,11 +1,11 @@
1
1
  /* -*- c-file-style: "ruby"; tab-width: 4 -*-
2
2
  *
3
- * Copyright (C) 2002-2005 Masao Mutoh
3
+ * Copyright (C) 2002-2006 Masao Mutoh
4
4
  *
5
5
  * You may redistribute it and/or modify it under the same
6
6
  * license terms as Ruby.
7
7
  *
8
- * $Id: _locale.c,v 1.2 2005/08/20 17:05:34 mutoh Exp $
8
+ * $Id: locale_system.c,v 1.3 2006/02/20 12:35:06 mutoh Exp $
9
9
  */
10
10
 
11
11
  #include "ruby.h"
@@ -29,11 +29,7 @@ static VALUE
29
29
  gt_locale_id_win32(self)
30
30
  VALUE self;
31
31
  {
32
- int lcid, pri_id, sub_id;
33
- lcid = GetUserDefaultLangID();
34
- pri_id = lcid & 0x3ff;
35
- sub_id = lcid >> 10;
36
- return rb_assoc_new(INT2FIX(pri_id), INT2FIX(sub_id));
32
+ return INT2NUM(GetUserDefaultLangID());
37
33
  }
38
34
  #endif
39
35
  static VALUE
@@ -64,23 +60,23 @@ gt_codeset(self)
64
60
  #endif
65
61
  }
66
62
 
67
- void Init__locale()
63
+ void Init_locale_system()
68
64
  {
69
65
  VALUE mLocale = rb_define_module("Locale");
70
-
66
+ VALUE mSystem = rb_define_module_under(mLocale, "System");
71
67
  #if defined HAVE_WINDOWS_H
72
- rb_define_module_function(mLocale, "__locale_id", gt_locale_id_win32, 0);
68
+ rb_define_module_function(mSystem, "locale_id", gt_locale_id_win32, 0);
73
69
  #endif
74
- rb_define_module_function(mLocale, "set", gt_setlocale, 2);
75
- rb_define_module_function(mLocale, "codeset", gt_codeset, 0);
70
+ rb_define_module_function(mSystem, "set", gt_setlocale, 2);
71
+ rb_define_module_function(mSystem, "codeset", gt_codeset, 0);
76
72
  # if defined HAVE_SETLOCALE
77
- rb_define_const(mLocale, "ALL", INT2NUM(LC_ALL));
78
- rb_define_const(mLocale, "COLLATE", INT2NUM(LC_COLLATE));
79
- rb_define_const(mLocale, "CTYPE", INT2NUM(LC_CTYPE));
80
- rb_define_const(mLocale, "MESSAGES", INT2NUM(LC_MESSAGES));
81
- rb_define_const(mLocale, "MONETARY", INT2NUM(LC_MONETARY));
82
- rb_define_const(mLocale, "NUMERIC", INT2NUM(LC_NUMERIC));
83
- rb_define_const(mLocale, "TIME", INT2NUM(LC_TIME));
73
+ rb_define_const(mSystem, "ALL", INT2NUM(LC_ALL));
74
+ rb_define_const(mSystem, "COLLATE", INT2NUM(LC_COLLATE));
75
+ rb_define_const(mSystem, "CTYPE", INT2NUM(LC_CTYPE));
76
+ rb_define_const(mSystem, "MESSAGES", INT2NUM(LC_MESSAGES));
77
+ rb_define_const(mSystem, "MONETARY", INT2NUM(LC_MONETARY));
78
+ rb_define_const(mSystem, "NUMERIC", INT2NUM(LC_NUMERIC));
79
+ rb_define_const(mSystem, "TIME", INT2NUM(LC_TIME));
84
80
  #endif
85
81
 
86
82
  }