ofm_gettext 2.0.0 → 2.0.1

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 (45) hide show
  1. data/COPYING +56 -0
  2. data/ChangeLog-1 +2016 -0
  3. data/NEWS-1 +414 -0
  4. data/gettext.gemspec +7 -8
  5. data/lib/gettext/runtime/class_info.rb +69 -0
  6. data/lib/gettext/runtime/locale_path.rb +123 -0
  7. data/lib/gettext/runtime/mofile.rb +332 -0
  8. data/lib/gettext/runtime/textdomain.rb +179 -0
  9. data/lib/gettext/runtime/textdomain_group.rb +26 -0
  10. data/lib/gettext/runtime/textdomain_manager.rb +214 -0
  11. data/lib/gettext/tools/parser/erb.rb +54 -0
  12. data/lib/gettext/tools/parser/glade.rb +100 -0
  13. data/lib/gettext/tools/parser/ruby.rb +226 -0
  14. data/lib/gettext/tools/pomessage.rb +199 -0
  15. data/lib/gettext/tools/poparser.rb +358 -0
  16. data/po/uk/rgettext.po +143 -0
  17. data/samples/cgi/po/uk/helloerb1.po +62 -0
  18. data/samples/cgi/po/uk/helloerb2.po +54 -0
  19. data/samples/cgi/po/uk/hellolib.po +26 -0
  20. data/samples/cgi/po/uk/main.po +84 -0
  21. data/samples/po/uk/hello.po +22 -0
  22. data/samples/po/uk/hello2.po +30 -0
  23. data/samples/po/uk/hello_glade2.po +34 -0
  24. data/samples/po/uk/hello_gtk.po +22 -0
  25. data/samples/po/uk/hello_noop.po +26 -0
  26. data/samples/po/uk/hello_plural.po +29 -0
  27. data/samples/po/uk/hello_tk.po +26 -0
  28. data/test/po/ja/test3.po +19 -0
  29. data/test/po/li/plural_error.po +27 -0
  30. data/test/test_locale_path.rb +76 -0
  31. data/test/test_po_generation.rb +22 -0
  32. data/test/test_pomessage.rb +101 -0
  33. data/test/test_textdomain_bind.rb +39 -0
  34. data/test/test_thread.rb +43 -0
  35. data/test/tools/files/app.pot +0 -0
  36. data/test/tools/files/de/app.po +0 -0
  37. data/test/tools/files/en/app.po +0 -0
  38. data/test/tools/files/en/test.po +21 -0
  39. data/test/tools/files/simple_1.po +2 -0
  40. data/test/tools/files/simple_2.po +2 -0
  41. data/test/tools/files/simple_translation.rb +3 -0
  42. data/test/tools/files/version.po +7 -0
  43. data/test/tools/test.pot +21 -0
  44. data/test/tools/test_tools.rb +63 -0
  45. metadata +380 -335
data/NEWS-1 ADDED
@@ -0,0 +1,414 @@
1
+ (OBSOLETE: Move to ChangeLog since 2.0.0)
2
+
3
+ = Ruby-GetText-Package-1.93.0 (2008-09-14)
4
+ * Bulgarian added.
5
+ * Estonian updated.
6
+ * French updated.
7
+ * Japanese updated.
8
+ * np_, npgettext support.
9
+ * Fixed bugs.
10
+ - detect the correct charset on POSIX OS.
11
+ - updatepo task works again on Windows OS(with broken GNU msgmerge).
12
+ - Remove BOM from po-files before GNU msgmerge is executed.
13
+ (GNU msgmerge doesn't support BOM)
14
+ - Work with xx(double x) library and the library which uses xx library
15
+ such as rcov.
16
+ - Fixed expire_fragment with rails < 2.1.
17
+
18
+ (NOTE) Rails-2.2 has not been supported yet.
19
+
20
+ Thanks to:
21
+ Translators:
22
+ Vincent Isambart, Erkki Eilonen, Sava Chankov.
23
+
24
+ Bug reports, suggestions and patches:
25
+ Vladimir Dobriakov, Tatsuki Sugiura, César Duque Calle,
26
+ Rémy-Christophe Schermesser, Donald Piret.
27
+
28
+ = Ruby-GetText-Package-1.92.0 (2008-08-02)
29
+ * Fixed a memory leak(again)
30
+ * Fixed bugs.
31
+ * Improve to support mo-files.
32
+ * Support revision 1 of mo-file format.
33
+ * Freeze msgstrs.
34
+ * msgctxt - pgettext(msgctxt, msgid) support
35
+ (eg)
36
+ p_("File", "Open") #=> "Open" is shown in English.
37
+ * Update translations
38
+ * Catalan, Chinese(Simplified), Chinese(Traditional), (English), Esperanto, German,
39
+ Greek, Hungarian, Latvian, Japanese, Norwegian, Portuguese(pt_BR), Russian, Serbian,
40
+ Spanish, Ukrainian, Vietnamese,
41
+ * Rails Support
42
+ * Support rubyonrails-2.1.0 (2.0.0 or later).
43
+ * Add new validations for activerecord-2.1.0.
44
+ (:greater_than, :greater_than_or_equal_to, :equal_to,
45
+ :less_than, :less_than_or_equal_to,:odd, :even)
46
+ * validates_(format|inclusion)_of accepts %{val} as the value
47
+ (eg)
48
+ validates_inclusion_of :name, :in => %w(a, b), :message => N_("%{fn} can't be %{val}")
49
+ * Work Fragment caching on rails-2.1.0.
50
+ * Support ActiveRecord::Base.abstract_class.
51
+ * Work ActiveRecord::Errors#[]
52
+ * Work render_partial.
53
+
54
+ Thanks to:
55
+ Translators:
56
+ Slobodan Paunović, Yuri Kozlov, Patrick Lenz, Malte Milatz, Ngoc DAO Thanh, David Espada,
57
+ Antonio S. de A. Terceiro, David Espada, Runar Ingebrigtsen, Tamás Tompa, Yang Bob, damphyr,
58
+ Ramon Salvadó, Alex Rootoff, Aivars Akots
59
+
60
+ Bug reports, suggestions and patches:
61
+ Hans de Graaff, Tatsuki Sugiura, Andreas Neuhaus, Loiseleur Michel
62
+
63
+ = Ruby-GetText-Package-1.91.0 (2008-05-11)
64
+ * Works again on Win32 + JRuby-1.1.1
65
+ * Fixed memory leaks.
66
+ * Fixed bugs.
67
+ * Speed up.
68
+ * Support Serbian(sr)
69
+ * Rails Support
70
+ * rubyonrails-1.2.x isn't supported(2.0.0 or later are supported).
71
+ * Localize ActionView::Helpers::FormBuilder#label.
72
+ e.g.)
73
+ <% form_for(@article) do |f| %>
74
+ <p><%= f.label :lastupdate %></p>
75
+ <% end %>
76
+ => msgid "Article|Lastupdate" is used as the label string.
77
+
78
+ Thanks to:
79
+ Translators:
80
+ Slobodan Paunović
81
+ Bug reports, suggestions and patches:
82
+ Paul Clegg, Locomotyphus, Simone Carletti, Dao Ngoc, Karl Palmskog,
83
+ Tatsuki Sugiura, Bernd Ahlers, craccho.
84
+
85
+ = Ruby-GetText-Package-1.90.0 (2008-01-30)
86
+ Start to prepare v2.0.
87
+
88
+ * Support Ukrainian(ua), Hungarian(hu)
89
+ * JRuby supported.
90
+ * Become a pure ruby library (Remove .so extention).
91
+ * Don't need C compiler to install.
92
+ * Unified to one gem package for all environments (Don't need Win32 package).
93
+ * Directory structures are refactored.
94
+ * locale modules separate from lib/gettext/ to lib/locale/.
95
+ * Locale modules are refactored. System locales become read only.
96
+ * Ruby on Rails 2.0 supported.
97
+ * RDoc supported.
98
+ * Fix bugs.
99
+ * Enhance to support Ruby on Rails.
100
+ * error_messages_for can accept custom error dialog messages.
101
+ * Add GetText::Rails.available_locales, .normalized_locale
102
+ and fragment_cache_key/expire_fragment reimplement to use these methods
103
+ to restrict cached locale files.
104
+
105
+ Thanks to:
106
+ Translators:
107
+ Alex Rootoff, Tamás Tompa
108
+ Bug reports, suggestions and patches:
109
+ Yaohan Chen, OZAWA Sakuro, olivier ruffin, Vít Ondruch,
110
+ Andreas Neuhaus, boud indymedia, Hans de Graaff, Stephan, Reynard,
111
+ Ernesto Jiménez Caballero, Paul Clegg
112
+
113
+ = Ruby-GetText-Package-1.10.0 (2007-07-06)
114
+
115
+ * Support Vietnamese(vi), Bosnian(bs), Croatian(hr), Norwegian(nb)
116
+ * Cache messages. Both _() and n_() become 1.3-1.8 times faster
117
+ than older version.
118
+ * Add GetText.ns_()
119
+ * Fix bugs.
120
+ * Enhance to support Ruby on Rails.
121
+ * Work with script/generate scaffold_resource.
122
+ * error_messages_for accepts plural models.
123
+ * Support Action/Fragment caching.
124
+
125
+ Thanks to:
126
+ Translators:
127
+ Dirkjan Bussink, Bart ten Brinke, Ngoc Dao, Sanjin Sehic,
128
+ Runar Ingebrigtsen, Menno Jonker, Joao Pedrosa, Malte Milatz,
129
+ Patrick Lenz, David Sulc, Erkki Eilonen, Yang Bob, Ramon Salvadó
130
+ Bug reports, suggestions and patches:
131
+ Maksim Bartenev, Bart ten Brinke, Florian Hufsky,
132
+ Michel Loiseleur, Sava Chankov
133
+
134
+ = Ruby-GetText-Package-1.9.0 (2007-01-22)
135
+
136
+ * Support Catalan(ca), Esperanto(eo)
137
+ * Update translations: zh_CN, zh_TW, cs, nl, en, de, el, es, ja, ko, pt_BR, ru.
138
+ * Support Ruby on Rails-1.2.1.
139
+ * Code cleanupand improved. Fixed bugs.
140
+
141
+ Thanks to:
142
+ Translators:
143
+ Antonio S. de A. Terceiro, David Espada, David Sulc, Gyoung-Yoon Noh,
144
+ Joao Pedrosa, Malte Milatz, Menno Jonkers, Patrick Lenz, Yang Bob,
145
+ Yuri Kozlov, Vassilis Rizopoulos
146
+
147
+ Bug reports, suggestions and patches:
148
+ Fabian Kreutz, KAKUTANI Shintaro, Mihnea Capraru, NANKI Haruo, pedro palazon
149
+
150
+ = Ruby-GetText-Package-1.8.0 (2006-09-11)
151
+
152
+ * Support Chinese(Taiwan: zh_TW), Estonian(et: rails.po only)
153
+ * Add GetText.bindtextdomain_to(klass, domainname), .textdomain_to(klass, domainname)
154
+ * rgettext supports -r, -d options.
155
+ -r is to set an option parser. -d is for debugging mode.
156
+ (e.g.) $ rgettext -r fooparser test.foo
157
+ * Update translations: pt_BR, de, zh_TW,
158
+ * Code cleanup, fixed bugs.
159
+ * Enhance to support Ruby on Rails.
160
+ * init_gettext finds mo-files in /vendor/plugins/{plugin_name}/locale which has
161
+ app/controller directories such as Rails Engines.
162
+ And init_gettext accepts :locale_path option to be able to set the locale
163
+ path manually.
164
+ * init_gettext manages plural textdomains.
165
+ * Add before_init_gettext, after_init_gettext methods like as before/after_filter.
166
+ * Speed up(the sample blog is 1.5 times faster).
167
+ * gettext/active_record.rb from gettext/rails.rb.
168
+ * ActiveRecord::Validations is set the app's textdomain in init_gettext.
169
+ It means the class which includes ActiveRecord::Validtaions are localized with
170
+ the app's textdomain.
171
+ e.g.) You can use gettext methods in the subclass of ActiveForm[1]
172
+ http://www.realityforge.org/svn/code/active-form/trunk/
173
+ * Works rails edge again (http://dev.rubyonrails.org/ticket/5810)
174
+
175
+ Thanks to:
176
+ Translators: Joao Pedrosa(pt_BR), Partick Lenz(de), Erkki Eilonen(et),
177
+ LIN CHUNG-YI(zh_TW)
178
+ Bug reports and suggestions:
179
+ Kobayashi Noritada, Andreas Neuhaus, steve dp, Tsutomu Kuroda, Donald Piret
180
+
181
+ = Ruby-GetText-Package-1.7.0 (2006-07-17)
182
+
183
+ * GetText.current_textdomain_info for debuging
184
+ * Fixed bugs, code cleanup.
185
+ * Update translations
186
+ * Chinese(zh), Czech(cs), Dutch(nl), English(default), French(fr)
187
+ Spanish(es), Japanese(ja), Korean(ko), Russian(ru)
188
+ * Improve to support Ruby on Rails
189
+ * Localize ActionView::Helpers::DateHelper.distance_of_time_in_words.
190
+ * Localize #error_message_on.
191
+ * Add ActiveRecord::Base.untranslate, .untranslate_all to prevend to
192
+ translate columns.
193
+
194
+ Thanks to:
195
+ Translators:
196
+ David Espada, Karel Miarka, Laurent Sansonetti, Yuri Kozlov,
197
+ Gyoung-Yoon Noh, Menno Jonkers, Yingfeng
198
+ Bug reports and suggestions:
199
+ arton, OZAWA Sakuro, kdmsnr, Kouhei Sutou
200
+
201
+ = Ruby-GetText-Package-1.6.0 (2006-06-09)
202
+
203
+ * Support Chinese(zh_CN), Italian(it).
204
+ * Improve the way to manage textdomains.
205
+ * A class/module can have plural textdomains.
206
+ * A textdomain belong to a class/module.
207
+ * A class/module can have plural textdomains.
208
+ * A message is looked up in its class/module and ancestors.
209
+
210
+ You don't need to call bindtextdomain in each files.
211
+ # A textdomain belong to a file in previous version.
212
+ # And a message is looked up in the file which called
213
+ # GetText functions only.
214
+ * Fix bugs
215
+ * Samples are cleaned up.
216
+
217
+ = Ruby-GetText-Package-1.5.0 (2006-05-07)
218
+
219
+ * Support Russian.
220
+ * Fix bugs.
221
+ * Refresh mo option was added.
222
+ Check mo files and reload it if it's updated.
223
+ ruby -d or GetText::TextDomain.check_mo=(true).
224
+ Or development mode in Ruby on Rails.
225
+
226
+ = Ruby-GetText-Package-1.4.0 (2006-04-15)
227
+
228
+ * Support OpenBSD.
229
+ * Fix bugs
230
+ * Enhance supports of Ruby on Rails.
231
+ * Improved ActionMailer localization support.
232
+ * Support ActionWebService
233
+ * test/gettext_test_rails.rb works with Rails-1.1.2.
234
+
235
+ = Ruby-GetText-Package-1.3.0 (2006-03-11)
236
+
237
+ * Improve Local::Object
238
+ * POSIX, C convert to "en".
239
+ * Enhance supports of Ruby on Rails.
240
+ * ActionMailer localization support.
241
+ * Use GetText function(_() N_() etc) in template.
242
+ * ISO-2022-JP charset is used when language is "ja"(Japanese).
243
+ * Localization templates support.
244
+ * ActionController::Base.render_text is overrided to find
245
+ localized templates such as foo_ja.rhml, foo_ja_JP.rhtml.
246
+ * @params["lang"] is treated as cgi["lang"]
247
+ * Use N_() as localized messages of validates_* instead of _().
248
+ * Translates ActiveRecord::Column.human_name values automatically.
249
+ * Fix memory leak, other bugs.
250
+
251
+ = Ruby-GetText-Package-1.2.0 (2006-02-23)
252
+
253
+ * Re-implement Locale module and Implements Locale::Object,
254
+ Locale::System, etc.
255
+ * Fix bugs.
256
+ * Apply RDoc (not complete)
257
+ * Improve to support Ruby on Rails.
258
+ * Add GetText.Nn_.
259
+ * Add rmsgmerge (Experimental)
260
+
261
+ = Ruby-GetText-Package-1.1.1 (2006-01-14)
262
+
263
+ * Bugfixes.
264
+ * Added Greek locale by damphyr.
265
+ * Support tests for Ruby on Rails.
266
+
267
+ = Ruby-GetText-Package-1.1.0 (2005-12-29)
268
+
269
+ * Added some functions which managed po/mo files easily.
270
+ * GetText.update_pofiles creates/updates pot/po files.
271
+ The idea is from Sascha Ebach.
272
+
273
+ * String% is extended to accept named argument.
274
+ "%{file} is selected." % {:file => "foo.rb"}
275
+ Proposed by Sascha Ebach and Kazuhiro NISHIYAMA.
276
+
277
+ * Enhanced Ruby on Rails support.
278
+ * ActiveRecord support. Inspired from Simon Santoro(rgtrans).
279
+ * the error messages are localized.
280
+ Also, you can add your own messages with _("").
281
+ * You can use gettext methods in the models unless
282
+ preparing anything.
283
+
284
+ * rgettext extracts the table names/field names
285
+ of the subclass of ActiveRecord::Base as the msgid.
286
+
287
+ Even for the English developers who don't need
288
+ to localize their application, this function is
289
+ useful because the developer can rename
290
+ the table/field names using "en" locale.
291
+
292
+ * More simple to set up ApplicationController.
293
+ Now, you need to call just init_gettext only.
294
+
295
+ class ApplicationController < ActionController::Base
296
+ init_gettext "myapp" #Easy!
297
+ end
298
+
299
+ This "myapp" domain affects all of the controllers/views/models.
300
+
301
+ * Sample "blog" application with rails.
302
+ Improved the sample application on RoR. See: samples/rails/*.
303
+
304
+ * New/Updated translations:
305
+ Czech - Karel Miarka (NEW)
306
+ Dutch - Menno Jonkers (NEW)
307
+ French - Laurent Sansonetti
308
+ German - Sasa Ebach
309
+ Japanese - Masao Mutoh
310
+ Korean - Gyoung-Yoon Noh
311
+ Portuguese(Brazil) - Joao Pedrosa
312
+ Spanish - David Espada
313
+
314
+ * bugfixes.
315
+
316
+ = Ruby-GetText-Package-1.0.0 (2005-09-03)
317
+
318
+ * Ruby on Rails is supported.
319
+ Includes sample in samples/rails/
320
+ * gem is supported. ($ gem install gettext)
321
+ * rake is supported.
322
+ * Not required racc anymore on installing time.
323
+ * New/Updated translations:
324
+ French - Laurent Sansonetti
325
+ German - Sven Herzberg
326
+ Japanese - Masao Mutoh
327
+ Korean - Gyoung-Yoon Noh (NEW)
328
+ Spanish - David Espada
329
+ * bugfixes.
330
+
331
+ * Moved to http://rubyforge.org/projects/gettext/
332
+ * Mailinglists started.
333
+
334
+
335
+ = Ruby-GetText-Package-0.9.0 (2005-05-01)
336
+
337
+ * CGI support: gettext/cgi
338
+ * ERB support: gettext/erb, rgettext.
339
+ * Added samples for CGI/ERB to samples/cgi/.
340
+ * bugfixes.
341
+
342
+
343
+ = Ruby-GetText-Package-0.8.1 (2005-03-30)
344
+
345
+ * bugfixes.
346
+ * New Translations: pt_BR by Joao Pedrosa.
347
+
348
+
349
+ = Ruby-GetText-Package-0.8.0 (2004-11-06)
350
+
351
+ * rgettext: Improved to parse ruby script.
352
+ * New Translations:
353
+ French - Laurent Sansonetti
354
+ Spanish - David Espada
355
+ Swedish - Nikolai Weibull
356
+ * Fixed bugs.
357
+
358
+
359
+ = Ruby-GetText-Package-0.7.0 (2004-10-25)
360
+
361
+ * Support GetText.sgettext.
362
+ See: http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC151
363
+ * Added gettext/iconv.rb.
364
+ If your ruby distribution doesn't have iconv.so but Ruby-GNOME2(Ruby/GTK2),
365
+ gettext/iconv.rb provides pseudo Iconv.iconv using Ruby/GLib module.
366
+ * GETTEXT_PATH as new environment variables. Define GETTEXT_PATH as locale
367
+ diretories. You can debug/test your application unless installing catalog
368
+ files.
369
+ * Update setup.rb(by Minero Aoki).
370
+ * Fix misc bugs
371
+
372
+
373
+ = Ruby-GetText-Package-0.6.1 (2004-07-23)
374
+
375
+ * rgettext: Fixed a bug of glade XML mode.
376
+ * Fixed an installation problem.
377
+ * Changed the installer from install.rb to setup.rb.
378
+
379
+
380
+ = Ruby-GetText-Package-0.6.0 (2004-07-05)
381
+
382
+ * rgettext: Support glade-2 XML file format.
383
+ * rgettext: Improved to parse ruby sources.
384
+ * rmsgfmt: Fix a bug that it generated wrong mo format.
385
+ * Fix bugs
386
+
387
+ = Ruby-GetText-Package-0.5.5 (2004-03-26)
388
+
389
+ * Fix a bug.
390
+
391
+ = Ruby-GetText-Package-0.5.4 (2004-02-14)
392
+
393
+ * Improved to support ruby-1.9.x.
394
+
395
+ = Ruby-GetText-Package-0.5.3 (2004-02-14)
396
+
397
+ * Improve the initial speed.
398
+
399
+ = Ruby-GetText-Package-0.5.2 (2003-11-12)
400
+
401
+ * Fix bugs for Win32.
402
+
403
+ = Ruby-GetText-Package-0.5.1 (2003-07-05)
404
+
405
+ * Fix bugs. Code cleanup.
406
+
407
+ = Ruby-GetText-Package-0.5.0 (2003-01-08)
408
+
409
+ * rmsgfmt: Added.
410
+ rmsgfmt is a ruby implementation of msgfmt in GNU gettext.
411
+ It creates a mo-file from a po-file.
412
+ * Fix bugs.
413
+
414
+
@@ -2,19 +2,18 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ofm_gettext}
5
- s.version = "2.0.0"
5
+ s.version = "2.0.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Masao Mutoh"]
9
- s.date = %q{2009-02-06}
10
- s.description = %q{Ruby-GetText-Package is a GNU GetText-like program for Ruby. The catalog file(po-file) is same format with GNU GetText. So you can use GNU GetText tools for maintaining.}
11
- s.email = %q{mutomasa at gmail.com}
8
+ s.authors = ["Masao Mutoh", "Vincent Pochet"]
9
+ s.date = %q{2011-05-26}
10
+ s.description = %q{Ruby-GetText-Package is a GNU GetText-like program for Ruby. The catalog file(po-file) is same format with GNU GetText. This package allows private and public translations.}
11
+ s.email = %q{vincent dot pochet at gmail.com}
12
12
  s.executables = ["rgettext", "rmsgmerge", "rmsgfmt"]
13
13
  s.extra_rdoc_files = ["lib/gettext.rb", "lib/gettext/tools.rb", "lib/gettext/core_ext/string.rb", "lib/gettext/version.rb", "README.rdoc"]
14
- s.files = ["po/hr/rgettext.po", "po/cs/rgettext.po",
15
- "po/el/rgettext.po", "po/bs/rgettext.po", "po/et/rgettext.po", "po/vi/rgettext.po", "po/pt_BR/rgettext.po", "po/nb/rgettext.po", "po/ko/rgettext.po", "po/lv/rgettext.po", "po/ru/rgettext.po", "po/zh_TW/rgettext.po", "po/rgettext.pot", "po/ca/rgettext.po", "po/de/rgettext.po", "po/es/rgettext.po", "po/eo/rgettext.po", "po/nl/rgettext.po", "po/sr/rgettext.po", "po/hu/rgettext.po", "po/zh/rgettext.po", "po/ja/rgettext.po", "po/bg/rgettext.po", "po/fr/rgettext.po", "po/sv/rgettext.po", "po/it/rgettext.po", "lib/gettext.rb", "lib/gettext/cgi.rb", "lib/gettext/utils.rb", "lib/gettext/tools.rb", "lib/gettext/core_ext/iconv.rb", "lib/gettext/core_ext/string.rb", "lib/gettext/version.rb", "lib/gettext/parser/glade.rb", "lib/gettext/parser/erb.rb", "lib/gettext/parser/ruby.rb", "lib/gettext/tools/rgettext.rb", "lib/gettext/tools/rmsgmerge.rb", "lib/gettext/tools/rmsgfmt.rb", "test/po/po/plural.po", "test/po/cr/plural.po", "test/po/sl/plural.po", "test/po/li/plural.po", "test/po/ir/plural.po", "test/po/ja/sgettext.po", "test/po/ja/test2.po", "test/po/ja/pgettext.po", "test/po/ja/test1.po", "test/po/ja/nsgettext.po", "test/po/ja/plural_error.po", "test/po/ja/plural.po", "test/po/ja/rubyparser.po", "test/po/ja/npgettext.po", "test/po/fr/test2.po", "test/po/fr/test1.po", "test/po/fr/plural_error.po", "test/po/fr/plural.po", "test/po/la/plural_error.po", "test/po/la/plural.po", "test/po/da/plural_error.po", "test/po/da/plural.po", "test/test_textdomain_toplevel.rb", "test/test_gettext.rb", "test/test_parser.rb", "test/README", "test/test_string.rb", "test/Rakefile", "test/test_class_info.rb", "test/test_textdomain_multi.rb", "test/testlib/simple.rb", "test/testlib/gettext.rb", "test/testlib/gladeparser.glade", "test/testlib/npgettext.rb", "test/testlib/multi_textdomain.rb", "test/testlib/erb.rhtml", "test/testlib/nsgettext.rb", "test/testlib/erb.rxml", "test/testlib/pgettext.rb", "test/testlib/helper.rb", "test/testlib/N_.rb", "test/testlib/ngettext.rb", "test/testlib/sgettext.rb", "bin/rgettext", "bin/rmsgmerge", "bin/rmsgfmt", "Rakefile", "README.rdoc", "ChangeLog", "src/poparser.ry", "samples/cgi/po/hr/main.po", "samples/cgi/po/hr/hellolib.po", "samples/cgi/po/hr/helloerb1.po", "samples/cgi/po/hr/helloerb2.po", "samples/cgi/po/cs/main.po", "samples/cgi/po/cs/hellolib.po", "samples/cgi/po/cs/helloerb1.po", "samples/cgi/po/cs/helloerb2.po", "samples/cgi/po/hellolib.pot", "samples/cgi/po/el/main.po", "samples/cgi/po/el/hellolib.po", "samples/cgi/po/el/helloerb1.po", "samples/cgi/po/el/helloerb2.po", "samples/cgi/po/bs/main.po", "samples/cgi/po/bs/hellolib.po", "samples/cgi/po/bs/helloerb1.po", "samples/cgi/po/bs/helloerb2.po", "samples/cgi/po/vi/main.po", "samples/cgi/po/vi/hellolib.po", "samples/cgi/po/vi/helloerb1.po", "samples/cgi/po/vi/helloerb2.po", "samples/cgi/po/pt_BR/main.po", "samples/cgi/po/pt_BR/hellolib.po", "samples/cgi/po/pt_BR/helloerb1.po", "samples/cgi/po/pt_BR/helloerb2.po", "samples/cgi/po/nb/main.po", "samples/cgi/po/nb/hellolib.po", "samples/cgi/po/nb/helloerb1.po", "samples/cgi/po/nb/helloerb2.po", "samples/cgi/po/ko/main.po", "samples/cgi/po/ko/hellolib.po", "samples/cgi/po/ko/helloerb1.po", "samples/cgi/po/ko/helloerb2.po", "samples/cgi/po/lv/main.po", "samples/cgi/po/lv/hellolib.po", "samples/cgi/po/lv/helloerb1.po", "samples/cgi/po/lv/helloerb2.po", "samples/cgi/po/ru/main.po", "samples/cgi/po/ru/hellolib.po", "samples/cgi/po/ru/helloerb1.po", "samples/cgi/po/ru/helloerb2.po", "samples/cgi/po/zh_TW/main.po", "samples/cgi/po/zh_TW/hellolib.po", "samples/cgi/po/zh_TW/helloerb1.po", "samples/cgi/po/zh_TW/helloerb2.po", "samples/cgi/po/ca/main.po", "samples/cgi/po/ca/hellolib.po", "samples/cgi/po/ca/helloerb1.po", "samples/cgi/po/ca/helloerb2.po", "samples/cgi/po/de/main.po", "samples/cgi/po/de/hellolib.po", "samples/cgi/po/de/helloerb1.po", "samples/cgi/po/de/helloerb2.po", "samples/cgi/po/es/main.po", "samples/cgi/po/es/hellolib.po", "samples/cgi/po/es/helloerb1.po", "samples/cgi/po/es/helloerb2.po", "samples/cgi/po/eo/main.po", "samples/cgi/po/eo/hellolib.po", "samples/cgi/po/eo/helloerb1.po", "samples/cgi/po/eo/helloerb2.po", "samples/cgi/po/nl/main.po", "samples/cgi/po/nl/hellolib.po", "samples/cgi/po/nl/helloerb1.po", "samples/cgi/po/nl/helloerb2.po", "samples/cgi/po/sr/main.po", "samples/cgi/po/sr/hellolib.po", "samples/cgi/po/sr/helloerb1.po", "samples/cgi/po/sr/helloerb2.po", "samples/cgi/po/hu/main.po", "samples/cgi/po/hu/hellolib.po", "samples/cgi/po/hu/helloerb1.po", "samples/cgi/po/hu/helloerb2.po", "samples/cgi/po/helloerb1.pot", "samples/cgi/po/helloerb2.pot", "samples/cgi/po/zh/main.po", "samples/cgi/po/zh/hellolib.po", "samples/cgi/po/zh/helloerb1.po", "samples/cgi/po/zh/helloerb2.po", "samples/cgi/po/ja/main.po", "samples/cgi/po/ja/hellolib.po", "samples/cgi/po/ja/helloerb1.po", "samples/cgi/po/ja/helloerb2.po", "samples/cgi/po/bg/main.po", "samples/cgi/po/bg/hellolib.po", "samples/cgi/po/bg/helloerb1.po", "samples/cgi/po/bg/helloerb2.po", "samples/cgi/po/main.pot", "samples/cgi/po/fr/main.po", "samples/cgi/po/fr/hellolib.po", "samples/cgi/po/fr/helloerb1.po", "samples/cgi/po/fr/helloerb2.po", "samples/cgi/po/it/main.po", "samples/cgi/po/it/hellolib.po", "samples/cgi/po/it/helloerb1.po", "samples/cgi/po/it/helloerb2.po", "samples/cgi/hellolib.rb", "samples/cgi/helloerb1.cgi", "samples/cgi/cookie.cgi", "samples/cgi/README", "samples/cgi/other.rhtml", "samples/cgi/Rakefile", "samples/cgi/gettext.css", "samples/cgi/helloerb2.cgi", "samples/cgi/http.rb", "samples/cgi/helloerb.rhtml", "samples/cgi/index.cgi", "samples/po/hello_plural.pot", "samples/po/hr/hello_glade2.po", "samples/po/hr/hello_plural.po", "samples/po/hr/hello_noop.po", "samples/po/hr/hello.po", "samples/po/hr/hello2.po", "samples/po/hr/hello_tk.po", "samples/po/hr/hello_gtk.po", "samples/po/cs/hello_glade2.po", "samples/po/cs/hello_plural.po", "samples/po/cs/hello_noop.po", "samples/po/cs/hello.po", "samples/po/cs/hello2.po", "samples/po/cs/hello_tk.po", "samples/po/cs/hello_gtk.po", "samples/po/el/hello_glade2.po", "samples/po/el/hello_plural.po", "samples/po/el/hello_noop.po", "samples/po/el/hello.po", "samples/po/el/hello2.po", "samples/po/el/hello_tk.po", "samples/po/el/hello_gtk.po", "samples/po/bs/hello_glade2.po", "samples/po/bs/hello_plural.po", "samples/po/bs/hello_noop.po", "samples/po/bs/hello.po", "samples/po/bs/hello2.po", "samples/po/bs/hello_tk.po", "samples/po/bs/hello_gtk.po", "samples/po/vi/hello_glade2.po", "samples/po/vi/hello_plural.po", "samples/po/vi/hello_noop.po", "samples/po/vi/hello.po", "samples/po/vi/hello2.po", "samples/po/vi/hello_tk.po", "samples/po/vi/hello_gtk.po", "samples/po/pt_BR/hello_glade2.po", "samples/po/pt_BR/hello_plural.po", "samples/po/pt_BR/hello_noop.po", "samples/po/pt_BR/hello.po", "samples/po/pt_BR/hello2.po", "samples/po/pt_BR/hello_tk.po", "samples/po/pt_BR/hello_gtk.po", "samples/po/nb/hello_glade2.po", "samples/po/nb/hello_plural.po", "samples/po/nb/hello_noop.po", "samples/po/nb/hello.po", "samples/po/nb/hello2.po", "samples/po/nb/hello_tk.po", "samples/po/nb/hello_gtk.po", "samples/po/hello_noop.pot", "samples/po/ko/hello_glade2.po", "samples/po/ko/hello_plural.po", "samples/po/ko/hello_noop.po", "samples/po/ko/hello.po", "samples/po/ko/hello2.po", "samples/po/ko/hello_tk.po", "samples/po/ko/hello_gtk.po", "samples/po/lv/hello_glade2.po", "samples/po/lv/hello_plural.po", "samples/po/lv/hello_noop.po", "samples/po/lv/hello.po", "samples/po/lv/hello2.po", "samples/po/lv/hello_tk.po", "samples/po/lv/hello_gtk.po", "samples/po/ru/hello_glade2.po", "samples/po/ru/hello_plural.po", "samples/po/ru/hello_noop.po", "samples/po/ru/hello.po", "samples/po/ru/hello2.po", "samples/po/ru/hello_tk.po", "samples/po/ru/hello_gtk.po", "samples/po/zh_TW/hello_glade2.po", "samples/po/zh_TW/hello_plural.po", "samples/po/zh_TW/hello_noop.po", "samples/po/zh_TW/hello.po", "samples/po/zh_TW/hello2.po", "samples/po/zh_TW/hello_tk.po", "samples/po/zh_TW/hello_gtk.po", "samples/po/ca/hello_glade2.po", "samples/po/ca/hello_plural.po", "samples/po/ca/hello_noop.po", "samples/po/ca/hello.po", "samples/po/ca/hello2.po", "samples/po/ca/hello_tk.po", "samples/po/ca/hello_gtk.po", "samples/po/hello2.pot", "samples/po/de/hello_glade2.po", "samples/po/de/hello_plural.po", "samples/po/de/hello_noop.po", "samples/po/de/hello.po", "samples/po/de/hello2.po", "samples/po/de/hello_tk.po", "samples/po/de/hello_gtk.po", "samples/po/es/hello_glade2.po", "samples/po/es/hello_plural.po", "samples/po/es/hello_noop.po", "samples/po/es/hello.po", "samples/po/es/hello2.po", "samples/po/es/hello_tk.po", "samples/po/es/hello_gtk.po", "samples/po/hello_gtk.pot", "samples/po/eo/hello_glade2.po", "samples/po/eo/hello_plural.po", "samples/po/eo/hello_noop.po", "samples/po/eo/hello.po", "samples/po/eo/hello2.po", "samples/po/eo/hello_tk.po", "samples/po/eo/hello_gtk.po", "samples/po/nl/hello_glade2.po", "samples/po/nl/hello_plural.po", "samples/po/nl/hello_noop.po", "samples/po/nl/hello.po", "samples/po/nl/hello2.po", "samples/po/nl/hello_tk.po", "samples/po/nl/hello_gtk.po", "samples/po/sr/hello_glade2.po", "samples/po/sr/hello_plural.po", "samples/po/sr/hello_noop.po", "samples/po/sr/hello.po", "samples/po/sr/hello2.po", "samples/po/sr/hello_tk.po", "samples/po/sr/hello_gtk.po", "samples/po/hello.pot", "samples/po/hu/hello_glade2.po", "samples/po/hu/hello_plural.po", "samples/po/hu/hello_noop.po", "samples/po/hu/hello.po", "samples/po/hu/hello2.po", "samples/po/hu/hello_tk.po", "samples/po/hu/hello_gtk.po", "samples/po/zh/hello_glade2.po", "samples/po/zh/hello_plural.po", "samples/po/zh/hello_noop.po", "samples/po/zh/hello.po", "samples/po/zh/hello2.po", "samples/po/zh/hello_tk.po", "samples/po/zh/hello_gtk.po", "samples/po/test.rb", "samples/po/ja/hello_glade2.po", "samples/po/ja/hello_plural.po", "samples/po/ja/hello_noop.po", "samples/po/ja/hello.po", "samples/po/ja/hello2.po", "samples/po/ja/hello_tk.po", "samples/po/ja/hello_gtk.po", "samples/po/bg/hello_glade2.po", "samples/po/bg/hello_plural.po", "samples/po/bg/hello_noop.po", "samples/po/bg/hello.po", "samples/po/bg/hello2.po", "samples/po/bg/hello_tk.po", "samples/po/bg/hello_gtk.po", "samples/po/fr/hello_glade2.po", "samples/po/fr/hello_plural.po", "samples/po/fr/hello_noop.po", "samples/po/fr/hello.po", "samples/po/fr/hello2.po", "samples/po/fr/hello_tk.po", "samples/po/fr/hello_gtk.po", "samples/po/hello_tk.pot", "samples/po/sv/hello_glade2.po", "samples/po/sv/hello_plural.po", "samples/po/sv/hello_noop.po", "samples/po/sv/hello.po", "samples/po/sv/hello2.po", "samples/po/sv/hello_tk.po", "samples/po/sv/hello_gtk.po", "samples/po/hello_glade2.pot", "samples/po/it/hello_glade2.po", "samples/po/it/hello_plural.po", "samples/po/it/hello_noop.po", "samples/po/it/hello.po", "samples/po/it/hello2.po", "samples/po/it/hello_tk.po", "samples/po/it/hello_gtk.po", "samples/hello_noop.rb", "samples/hello_plural.rb", "samples/makemo.rb", "samples/hello_glade2.glade", "samples/hello.rb", "samples/hello_gtk2.rb", "samples/README", "samples/hello_glade2.rb", "samples/hello2.rb", "samples/hello_tk.rb", "gettext.gemspec"]
14
+ s.files = Dir["**/*"].to_a
16
15
  s.has_rdoc = true
17
- s.homepage = %q{http://gettext.rubyforge.org/}
16
+ s.homepage = %q{https://github.com/vincent-pochet/gettext}
18
17
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "GetText", "--main", "README.rdoc"]
19
18
  s.require_paths = ["lib"]
20
19
  s.rubyforge_project = %q{gettext}
@@ -0,0 +1,69 @@
1
+ # encoding: utf-8
2
+
3
+ require 'locale/util/memoizable'
4
+
5
+ module GetText
6
+ # For normalize/finding the related classes/modules.
7
+ # This is used for realizing the scope of TextDomain.
8
+ # (see: http://www.yotabanana.com/hiki/ruby-gettext-scope.html)
9
+ module ClassInfo
10
+ extend self
11
+ include Locale::Util::Memoizable
12
+
13
+ # normalize the class name
14
+ # klass should kind of the class, not object.
15
+ def normalize_class(klass)
16
+ ret = (klass.kind_of? Module) ? klass : klass.class
17
+ if ret.name =~ /^\#<|^$/ or ret == GetText or ret.name.nil?
18
+ ret = Object
19
+ end
20
+ ret
21
+ end
22
+
23
+ def root_ancestors # :nodoc:
24
+ Object.ancestors
25
+ end
26
+ memoize :root_ancestors
27
+
28
+ # Internal method for related_classes.
29
+ def related_classes_internal(klass, all_classes = [], analyzed_classes = [] )
30
+ ret = []
31
+ klass = normalize_class(klass)
32
+
33
+ return [Object] if root_ancestors.include? klass
34
+
35
+ ary = klass.name.split(/::/)
36
+ while(v = ary.shift)
37
+ ret.unshift(((ret.size == 0) ? Object.const_get(v) : ret[0].const_get(v)))
38
+ end
39
+ ret -= analyzed_classes
40
+ if ret.size > 1
41
+ ret += related_classes_internal(ret[1], all_classes, analyzed_classes)
42
+ ret.uniq!
43
+ end
44
+ analyzed_classes << klass unless analyzed_classes.include? klass
45
+
46
+ klass.ancestors[1..-1].each do |a|
47
+ ret += related_classes_internal(a, all_classes, analyzed_classes)
48
+ ret.uniq!
49
+ end
50
+
51
+ if all_classes.size > 0
52
+ (ret & all_classes).uniq
53
+ else
54
+ ret.uniq
55
+ end
56
+ end
57
+
58
+ # Returns the classes which related to klass
59
+ # (klass's ancestors, included modules and nested modules)
60
+ def related_classes(klass, all_classes = [])
61
+ ret = related_classes_internal(klass, all_classes)
62
+ unless ret.include? Object
63
+ ret += [Object]
64
+ end
65
+ ret
66
+ end
67
+ memoize :related_classes
68
+ end
69
+ end