gettext 1.6.0-mswin32 → 1.7.0-mswin32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. data/ChangeLog +65 -0
  2. data/NEWS +20 -0
  3. data/README +9 -9
  4. data/Rakefile +4 -4
  5. data/data/locale/cs/LC_MESSAGES/rails.mo +0 -0
  6. data/data/locale/cs/LC_MESSAGES/rgettext.mo +0 -0
  7. data/data/locale/de/LC_MESSAGES/rails.mo +0 -0
  8. data/data/locale/de/LC_MESSAGES/rgettext.mo +0 -0
  9. data/data/locale/el/LC_MESSAGES/rails.mo +0 -0
  10. data/data/locale/el/LC_MESSAGES/rgettext.mo +0 -0
  11. data/data/locale/es/LC_MESSAGES/rails.mo +0 -0
  12. data/data/locale/es/LC_MESSAGES/rgettext.mo +0 -0
  13. data/data/locale/fr/LC_MESSAGES/rails.mo +0 -0
  14. data/data/locale/fr/LC_MESSAGES/rgettext.mo +0 -0
  15. data/data/locale/it/LC_MESSAGES/rails.mo +0 -0
  16. data/data/locale/it/LC_MESSAGES/rgettext.mo +0 -0
  17. data/data/locale/ja/LC_MESSAGES/rails.mo +0 -0
  18. data/data/locale/ja/LC_MESSAGES/rgettext.mo +0 -0
  19. data/data/locale/ko/LC_MESSAGES/rails.mo +0 -0
  20. data/data/locale/ko/LC_MESSAGES/rgettext.mo +0 -0
  21. data/data/locale/nl/LC_MESSAGES/rails.mo +0 -0
  22. data/data/locale/nl/LC_MESSAGES/rgettext.mo +0 -0
  23. data/data/locale/pt_BR/LC_MESSAGES/rails.mo +0 -0
  24. data/data/locale/pt_BR/LC_MESSAGES/rgettext.mo +0 -0
  25. data/data/locale/ru/LC_MESSAGES/rails.mo +0 -0
  26. data/data/locale/ru/LC_MESSAGES/rgettext.mo +0 -0
  27. data/data/locale/sv/LC_MESSAGES/rgettext.mo +0 -0
  28. data/data/locale/zh/LC_MESSAGES/rails.mo +0 -0
  29. data/data/locale/zh/LC_MESSAGES/rgettext.mo +0 -0
  30. data/ext/gettext/Makefile +178 -0
  31. data/ext/gettext/locale_system-i386-mswin32.def +2 -0
  32. data/ext/gettext/locale_system-i386-mswin32.exp +0 -0
  33. data/ext/gettext/locale_system-i386-mswin32.lib +0 -0
  34. data/ext/gettext/locale_system-i386-mswin32.pdb +0 -0
  35. data/ext/gettext/locale_system.obj +0 -0
  36. data/ext/gettext/locale_system.so +0 -0
  37. data/ext/gettext/mkmf.log +16 -0
  38. data/ext/gettext/vc70.pdb +0 -0
  39. data/lib/gettext.rb +38 -12
  40. data/lib/gettext/container.rb +2 -2
  41. data/lib/gettext/iconv.rb +2 -2
  42. data/lib/gettext/locale_cgi.rb +3 -2
  43. data/lib/gettext/locale_object.rb +8 -8
  44. data/lib/gettext/locale_posix.rb +2 -2
  45. data/lib/gettext/locale_table_win32.rb +3 -3
  46. data/lib/gettext/locale_win32.rb +2 -2
  47. data/lib/gettext/mo.rb +5 -2
  48. data/lib/gettext/parser/activerecord.rb +27 -17
  49. data/lib/gettext/parser/glade.rb +7 -11
  50. data/lib/gettext/parser/ruby.rb +2 -3
  51. data/lib/gettext/poparser.rb +298 -298
  52. data/lib/gettext/rails.rb +220 -85
  53. data/lib/gettext/rgettext.rb +2 -2
  54. data/lib/gettext/rmsgfmt.rb +3 -3
  55. data/lib/gettext/rmsgmerge.rb +2 -2
  56. data/lib/gettext/string.rb +2 -1
  57. data/lib/gettext/textdomain.rb +5 -2
  58. data/lib/gettext/textdomainmanager.rb +3 -3
  59. data/lib/gettext/version.rb +1 -1
  60. data/lib/locale_system.so +0 -0
  61. data/po/cs/rails.po +63 -22
  62. data/po/cs/rgettext.po +71 -37
  63. data/po/de/rails.po +54 -16
  64. data/po/de/rgettext.po +56 -22
  65. data/po/el/rails.po +54 -16
  66. data/po/el/rgettext.po +56 -22
  67. data/po/es/rails.po +57 -20
  68. data/po/es/rgettext.po +70 -30
  69. data/po/fr/rails.po +57 -19
  70. data/po/fr/rgettext.po +61 -25
  71. data/po/it/rails.po +54 -16
  72. data/po/it/rgettext.po +56 -22
  73. data/po/ja/rails.po +55 -18
  74. data/po/ja/rgettext.po +58 -24
  75. data/po/ko/rails.po +68 -33
  76. data/po/ko/rgettext.po +77 -37
  77. data/po/nl/rails.po +61 -22
  78. data/po/nl/rgettext.po +72 -36
  79. data/po/pt_BR/rails.po +54 -16
  80. data/po/pt_BR/rgettext.po +56 -22
  81. data/po/rails.pot +54 -16
  82. data/po/rgettext.pot +55 -21
  83. data/po/ru/rails.po +68 -26
  84. data/po/ru/rgettext.po +70 -30
  85. data/po/sv/rgettext.po +55 -21
  86. data/po/zh/rails.po +51 -16
  87. data/po/zh/rgettext.po +59 -23
  88. data/samples/rails/app/controllers/application.rb +7 -1
  89. data/samples/rails/app/models/article.rb +0 -6
  90. data/samples/rails/locale/cs/LC_MESSAGES/gettext_plugin.mo +0 -0
  91. data/samples/rails/locale/de/LC_MESSAGES/gettext_plugin.mo +0 -0
  92. data/samples/rails/locale/el/LC_MESSAGES/gettext_plugin.mo +0 -0
  93. data/samples/rails/locale/es/LC_MESSAGES/gettext_plugin.mo +0 -0
  94. data/samples/rails/locale/fr/LC_MESSAGES/gettext_plugin.mo +0 -0
  95. data/samples/rails/locale/ja/LC_MESSAGES/gettext_plugin.mo +0 -0
  96. data/samples/rails/locale/ko/LC_MESSAGES/gettext_plugin.mo +0 -0
  97. data/samples/rails/locale/nl/LC_MESSAGES/gettext_plugin.mo +0 -0
  98. data/samples/rails/locale/pt_BR/LC_MESSAGES/gettext_plugin.mo +0 -0
  99. data/samples/rails/locale/ru/LC_MESSAGES/gettext_plugin.mo +0 -0
  100. data/src/poparser.ry +1 -1
  101. data/test/gettext_test.rb +1 -1
  102. data/test/gettext_test_parser.rb +0 -1
  103. data/test/test_rubyparser.rb +0 -11
  104. metadata +21 -7
data/lib/gettext/rails.rb CHANGED
@@ -6,15 +6,14 @@
6
6
  You may redistribute it and/or modify it under the same
7
7
  license terms as Ruby.
8
8
 
9
- $Id: rails.rb,v 1.36 2006/06/04 14:43:37 mutoh Exp $
9
+ $Id: rails.rb,v 1.43 2006/07/16 15:19:17 mutoh Exp $
10
10
  =end
11
11
 
12
12
  require 'gettext/cgi'
13
13
  require 'active_record'
14
14
  require 'active_support'
15
15
 
16
- module GetText #:nodoc:
17
- # = GetText for Ruby on Rails
16
+ module GetText
18
17
  # GetText::Rails supports Ruby on Rails.
19
18
  # You add only 2 lines in your controller, all of the controller/view/models are
20
19
  # targeted the textdomain.
@@ -32,6 +31,9 @@ module GetText #:nodoc:
32
31
  end
33
32
 
34
33
  module_function
34
+ # call-seq:
35
+ # bindtextdomain(domainname, options = {})
36
+ #
35
37
  # Bind a textdomain(#{path}/#{locale}/LC_MESSAGES/#{domainname}.mo) to your program.
36
38
  # Notes the textdomain scope becomes all of the controllers/views/models in your app.
37
39
  # This is different from normal GetText.bindtextomain.
@@ -43,16 +45,16 @@ module GetText #:nodoc:
43
45
  #
44
46
  # * domainname: the textdomain name.
45
47
  # * options: options as a Hash.
46
- # * :locale - the locale value such as "ja-JP". When the value is nil,
47
- # locale is searched the order by this value > "lang" value of QUERY_STRING >
48
- # params["lang"] > "lang" value of Cookie > HTTP_ACCEPT_LANGUAGE value
49
- # > Default locale(en).
50
- # * :path - the path to the mo-files. Default is "RAIL_ROOT/locale".
51
- # * :charset - the charset. Generally UTF-8 is recommanded.
52
- # And the charset is set order by "the argument of bindtextdomain"
53
- # > HTTP_ACCEPT_CHARSET > Default charset(UTF-8).
54
- # * :with_model - false if you want to ignore ActiveRecord support.
55
- # * :with_helper - false if you want to ignore ApplicationHelper support.
48
+ # * :locale - the locale value such as "ja-JP". When the value is nil,
49
+ # locale is searched the order by this value > "lang" value of QUERY_STRING >
50
+ # params["lang"] > "lang" value of Cookie > HTTP_ACCEPT_LANGUAGE value
51
+ # > Default locale(en).
52
+ # * :path - the path to the mo-files. Default is "RAIL_ROOT/locale".
53
+ # * :charset - the charset. Generally UTF-8 is recommanded.
54
+ # And the charset is set order by "the argument of bindtextdomain"
55
+ # > HTTP_ACCEPT_CHARSET > Default charset(UTF-8).
56
+ # * :with_model - false if you want to ignore ActiveRecord support.
57
+ # * :with_helper - false if you want to ignore ApplicationHelper support.
56
58
  #
57
59
  # Note: Don't use locale, charset, with_model argument(not in options).
58
60
  # They are remained for backward compatibility.
@@ -126,8 +128,8 @@ module ActionController #:nodoc:
126
128
  # Bind a 'textdomain' to all of the controllers/views/models. Call this instead of GetText.bindtextdomain.
127
129
  # * textdomain: the textdomain
128
130
  # * options: options as a Hash.
129
- # * :charset - the output charset. Default is "UTF-8"
130
- # * :content_type - the content type. Default is "text/html"
131
+ # * :charset - the output charset. Default is "UTF-8"
132
+ # * :content_type - the content type. Default is "text/html"
131
133
  #
132
134
  # locale is searched the order by @params["lang"] > "lang" value of QUERY_STRING >
133
135
  # "lang" value of Cookie > HTTP_ACCEPT_LANGUAGE value > Default locale(en).
@@ -156,6 +158,12 @@ module ActionController #:nodoc:
156
158
  @@gettext_domainname = domainname
157
159
  @@gettext_content_type = opt[:content_type]
158
160
  end
161
+
162
+ # Gets the textdomain name of this controller.
163
+ def self.textdomainname
164
+ @@gettext_domainname
165
+ end
166
+
159
167
  end
160
168
 
161
169
  class TestRequest < AbstractRequest #:nodoc:
@@ -168,6 +176,11 @@ module ActionController #:nodoc:
168
176
  end
169
177
 
170
178
  module ActiveRecord #:nodoc:
179
+ class Migration
180
+ extend GetText
181
+ include GetText
182
+ end
183
+
171
184
  module ConnectionAdapters #:nodoc:
172
185
  # An abstract definition of a column in a table.
173
186
  class Column
@@ -178,46 +191,79 @@ module ActiveRecord #:nodoc:
178
191
  end
179
192
  end
180
193
  end
194
+
195
+ module Validations # :nodoc:
196
+ def self.append_features(base) # :nodoc:
197
+ super
198
+ base.extend ClassMethods
199
+ base.class_eval{
200
+ def gettext(str) #:nodoc:
201
+ _(str)
202
+ end
203
+ def self.human_attribute_name(attribute_key_name) #:nodoc:
204
+ s_("#{self}|#{attribute_key_name.humanize}")
205
+ end
206
+
207
+ def self.human_attribute_table_name_for_error(table_name) #:nodoc:
208
+ _(table_name.gsub(/_/, " "))
209
+ end
210
+ }
211
+ end
212
+
213
+ module ClassMethods #:nodoc:
214
+ @@custom_error_messages_d = {}
215
+
216
+ # Very ugly but...
217
+ def validates_length_of(*attrs) #:nodoc:
218
+ if attrs.last.is_a?(Hash)
219
+ msg = attrs.last[:message]
220
+ if msg
221
+ @@custom_error_messages_d[msg] = /#{Regexp.escape(msg).sub(/%d/, '(\d+)')}/
222
+ end
223
+ end
224
+ validates_size_of(*attrs)
225
+ end
226
+
227
+ def custom_error_messages_d #:nodoc:
228
+ @@custom_error_messages_d
229
+ end
230
+ end
231
+ def custom_error_messages_d #:nodoc:
232
+ self.class.custom_error_messages_d
233
+ end
234
+ end
181
235
 
182
236
  class Base
183
- def self.human_attribute_name(attribute_key_name) #:nodoc:
184
- s_("#{self}|#{attribute_key_name.humanize}")
237
+ include GetText::Rails
238
+ include Validations
239
+
240
+ @@gettext_untranslate = false
241
+ @@gettext_untranslate_columns = []
242
+
243
+ # Untranslate all of the tablename/fieldnames in this model class.
244
+ def self.untranslate_all
245
+ @@gettext_untranslate = true
185
246
  end
186
247
 
187
- def self.human_attribute_table_name_for_error(table_name) #:nodoc:
188
- _(table_name.gsub(/_/, " "))
248
+ # Returns true if "untranslate_all" is called. Otherwise false.
249
+ def self.untranslate_all?
250
+ @@gettext_untranslate
189
251
  end
190
252
 
191
- @@error_message_title = nil
192
- @@error_message_explanation = nil
193
-
194
- # call-seq:
195
- # set_error_message_title(msg)
196
- #
197
- # Sets a your own title of error message dialog.
198
- # * msg: [single_msg, plural_msg]. Usually you need to call this with Nn_().
199
- # * Returns: [single_msg, plural_msg]
200
- def self.set_error_message_title(msg, plural_msg = nil)
201
- if msg.kind_of? Array
202
- single_msg = msg[0]
203
- plural_msg = msg[1]
204
- else
205
- single_msg = msg
206
- end
207
- @@error_message_title = [single_msg, plural_msg]
253
+ # Sets the untranslate columns.
254
+ # (e.g.) untranslate :foo, :bar, :baz
255
+ def self.untranslate(*w)
256
+ @@gettext_untranslate_columns += w.collect{|v| v.to_s}
208
257
  end
209
258
 
210
- # Very ugly but...
211
- @@custom_error_messages_d = {}
212
- def self.validates_length_of(*attrs) #:nodoc:
213
- if attrs.last.is_a?(Hash)
214
- msg = attrs.last[:message]
215
- @@custom_error_messages_d[msg] = /#{Regexp.escape(msg).sub(/%d/, '(\d+)')}/ if msg
216
- end
217
- validates_size_of(*attrs)
259
+ # Returns true if the column is set "untranslate".
260
+ # (e.g.) untranslate? :foo
261
+ def self.untranslate?(columnname)
262
+ @@gettext_untranslate_columns.include?(columnname)
218
263
  end
219
- def custom_error_messages_d #:nodoc:
220
- @@custom_error_messages_d
264
+
265
+ def self.untranslate_data #:nodoc:
266
+ [@@gettext_untranslate, @@gettext_untranslate_columns]
221
267
  end
222
268
 
223
269
  def self.columns
@@ -230,46 +276,40 @@ module ActiveRecord #:nodoc:
230
276
  end
231
277
  @columns
232
278
  end
279
+
280
+ # call-seq:
281
+ # set_error_message_title(msg)
282
+ #
283
+ # ((*Deprecated*))
284
+ # Use ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_title
285
+ # instead.
286
+ #
287
+ # Sets a your own title of error message dialog.
288
+ # * msg: [single_msg, plural_msg]. Usually you need to call this with Nn_().
289
+ # * Returns: [single_msg, plural_msg]
290
+ def self.set_error_message_title(msg, plural_msg = nil)
291
+ ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_title(msg, plural_msg)
292
+ end
233
293
 
234
294
  # call-seq:
235
295
  # set_error_message_explanation(msg)
236
296
  #
297
+ # ((*Deprecated*))
298
+ # Use ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_explanation
299
+ # instead.
300
+ #
237
301
  # Sets a your own explanation of the error message dialog.
238
302
  # * msg: [single_msg, plural_msg]. Usually you need to call this with Nn_().
239
303
  # * Returns: [single_msg, plural_msg]
240
304
  def self.set_error_message_explanation(msg, plural_msg = nil)
241
- if msg.kind_of? Array
242
- single_msg = msg[0]
243
- plural_msg = msg[1]
244
- else
245
- single_msg = msg
246
- end
247
- @@error_message_explanation = [single_msg, plural_msg]
248
- end
249
-
250
- def error_message_title #:nodoc:
251
- if @@error_message_title
252
- [_(@@error_message_title[0]), _(@@error_message_title[1])]
253
- else
254
- nil
255
- end
256
- end
257
- def error_message_explanation #:nodoc:
258
- if @@error_message_explanation
259
- [_(@@error_message_explanation[0]), _(@@error_message_explanation[1])]
260
- else
261
- nil
262
- end
263
- end
264
-
265
- def gettext(str) #:nodoc:
266
- _(str)
305
+ ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_explanation(msg, plural_msg)
267
306
  end
268
307
  end
269
308
 
309
+ # activerecord-1.14.3/lib/active_record/validations.rb
270
310
  class Errors #:nodoc:
271
311
  include GetText
272
-
312
+
273
313
  RE_FIELD_NAME = /%\{fn\}/ #:nodoc:
274
314
 
275
315
  # You need to define this here, because this values will be updated by application.
@@ -294,8 +334,8 @@ module ActiveRecord #:nodoc:
294
334
  }
295
335
  cattr_accessor :default_error_messages_d
296
336
 
297
- def full_messages #:nodoc:
298
- full_messages = []
337
+ def localize_error_messages # :nodoc:
338
+ errors = {}
299
339
  @errors.each_key do |attr|
300
340
  @errors[attr].each do |msg|
301
341
  next if msg.nil?
@@ -305,8 +345,8 @@ module ActiveRecord #:nodoc:
305
345
  if regexp =~ msg
306
346
  custom_msg = @base.gettext(key)
307
347
  custom_msg = _(msg) if custom_msg == msg
308
- custom_msg = _(custom_msg) % $1.to_i
309
- break
348
+ custom_msg = _(custom_msg) % $1.to_i
349
+ break
310
350
  end
311
351
  end
312
352
  unless custom_msg
@@ -314,14 +354,36 @@ module ActiveRecord #:nodoc:
314
354
  custom_msg = _(msg) if custom_msg == msg
315
355
  end
316
356
  if attr == "base"
317
- full_messages << custom_msg
357
+ full_message = custom_msg
318
358
  elsif RE_FIELD_NAME =~ custom_msg
319
- full_messages << custom_msg % {:fn => @base.class.human_attribute_name(attr)}
359
+ full_message = custom_msg % {:fn => @base.class.human_attribute_name(attr)}
320
360
  else
321
- full_messages << @base.class.human_attribute_name(attr) + " " + custom_msg
361
+ full_message = @base.class.human_attribute_name(attr) + " " + custom_msg
322
362
  end
363
+ errors[attr] = full_message
323
364
  end
324
365
  end
366
+ errors
367
+ end
368
+
369
+ def on(attribute) #:nodoc:
370
+ errors = localize_error_messages
371
+ if errors[attribute.to_s].nil?
372
+ nil
373
+ elsif errors[attribute.to_s].length == 1
374
+ errors[attribute.to_s].first
375
+ else
376
+ errors[attribute.to_s]
377
+ end
378
+ end
379
+
380
+ def full_messages #:nodoc:
381
+ full_messages = []
382
+ errors = localize_error_messages
383
+ errors.each do |attr, msg|
384
+ next if msg.nil?
385
+ full_messages << msg
386
+ end
325
387
  full_messages
326
388
  end
327
389
  end
@@ -349,7 +411,8 @@ module ActionView #:nodoc:
349
411
  module L10n
350
412
  # Separate namespace for textdomain
351
413
  include GetText
352
- extend GetText
414
+
415
+ bindtextdomain("rails")
353
416
 
354
417
  @error_message_title = Nn_("%{num} error prohibited this %{record} from being saved",
355
418
  "%{num} errors prohibited this %{record} from being saved")
@@ -357,9 +420,56 @@ module ActionView #:nodoc:
357
420
  "There were problems with the following fields:")
358
421
 
359
422
  module_function
423
+ # call-seq:
424
+ # set_error_message_title(msgs)
425
+ #
426
+ # Sets a your own title of error message dialog.
427
+ # * msgs: [single_msg, plural_msg]. Usually you need to call this with Nn_().
428
+ # * Returns: [single_msg, plural_msg]
429
+ def set_error_message_title(msg, plural_msg = nil)
430
+ if msg.kind_of? Array
431
+ single_msg = msg[0]
432
+ plural_msg = msg[1]
433
+ else
434
+ single_msg = msg
435
+ end
436
+ @error_message_title = [single_msg, plural_msg]
437
+ end
438
+
439
+ # call-seq:
440
+ # set_error_message_explanation(msg)
441
+ #
442
+ # Sets a your own explanation of the error message dialog.
443
+ # * msg: [single_msg, plural_msg]. Usually you need to call this with Nn_().
444
+ # * Returns: [single_msg, plural_msg]
445
+ def set_error_message_explanation(msg, plural_msg = nil)
446
+ if msg.kind_of? Array
447
+ single_msg = msg[0]
448
+ plural_msg = msg[1]
449
+ else
450
+ single_msg = msg
451
+ end
452
+ @error_message_explanation = [single_msg, plural_msg]
453
+ end
454
+
455
+ def error_message_title #:nodoc:
456
+ if @error_message_title
457
+ [_(@error_message_title[0]), _(@error_message_title[1])]
458
+ else
459
+ nil
460
+ end
461
+ end
462
+ def error_message_explanation #:nodoc:
463
+ if @error_message_explanation
464
+ [_(@error_message_explanation[0]), _(@error_message_explanation[1])]
465
+ else
466
+ nil
467
+ end
468
+ end
469
+
360
470
  def render_error_message(object, klass, record, count, options)
361
- message_title = object.error_message_title || @error_message_title
362
- message_explanation = object.error_message_explanation || @error_message_explanation
471
+ message_title = @error_message_title
472
+ message_explanation = @error_message_explanation
363
473
 
364
474
  klass.content_tag("div",
365
475
  klass.content_tag(
@@ -373,8 +483,6 @@ module ActionView #:nodoc:
373
483
  end
374
484
 
375
485
  def error_messages_for(object, object_name, klass, options = {})
376
- textdomain("rails")
377
-
378
486
  options = options.symbolize_keys
379
487
 
380
488
  if object && ! object.errors.empty?
@@ -389,6 +497,33 @@ module ActionView #:nodoc:
389
497
  L10n.error_messages_for(object, object_name, self, options)
390
498
  end
391
499
  end
500
+
501
+ module DateHelper #:nodoc: all
502
+ include GetText
503
+ alias distance_of_time_in_words_without_locale distance_of_time_in_words #:nodoc:
504
+
505
+ bindtextdomain("rails")
506
+
507
+ # This is FAKE constant. The messages are found by rgettext as the msgid.
508
+ MESSAGESS = [N_('less than 5 seconds'), N_('less than 10 seconds'), N_('less than 20 seconds'),
509
+ N_('half a minute'), N_('less than a minute')]
510
+ MINUTES = [/^(\d+) minutes?$/, Nn_('1 minute', '%{num} minutes')]
511
+ HOURS = [/^about (\d+) hours?$/, Nn_('about 1 hour', 'about %{num} hours')]
512
+ DAYS = [/^(\d+) days?$/, Nn_('1 day', '%{num} days')]
513
+
514
+ def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false)
515
+ msg = distance_of_time_in_words_without_locale(from_time, to_time, include_seconds)
516
+ match = false
517
+ [MINUTES, HOURS, DAYS].each do |regexp, nn|
518
+ if regexp =~ msg
519
+ match = true
520
+ msg = n_(nn, $1.to_i) % {:num => $1}
521
+ break
522
+ end
523
+ end
524
+ match ? msg : _(msg)
525
+ end
526
+ end
392
527
  end
393
528
  end
394
529
 
@@ -18,14 +18,14 @@ require 'rbconfig'
18
18
 
19
19
  module GetText
20
20
 
21
- module RGetText # :nodoc:
21
+ module RGetText #:nodoc:
22
22
  extend GetText
23
23
 
24
24
  bindtextdomain("rgettext")
25
25
 
26
26
  # constant values
27
27
  VERSION = GetText::VERSION
28
- DATE = %w($Date: 2006/06/04 15:07:34 $)[1]
28
+ DATE = %w($Date: 2006/06/11 15:36:20 $)[1]
29
29
  MAX_LINE_LEN = 70
30
30
 
31
31
  @ex_parsers = []