when_exe 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. data/bin/irb.rc +1 -0
  2. data/bin/locales.rb +8 -6
  3. data/bin/when.rb +1 -1
  4. data/lib/when_exe.rb +231 -146
  5. data/lib/when_exe/basictypes.rb +108 -18
  6. data/lib/when_exe/calendarnote.rb +263 -116
  7. data/lib/when_exe/calendartypes.rb +413 -22
  8. data/lib/when_exe/coordinates.rb +58 -36
  9. data/lib/when_exe/core/compatibility.rb +8 -6
  10. data/lib/when_exe/core/extension.rb +40 -15
  11. data/lib/when_exe/ephemeris.rb +20 -19
  12. data/lib/when_exe/{region → ephemeris}/moon.rb +4 -4
  13. data/lib/when_exe/{region/ephemeric_notes.rb → ephemeris/notes.rb} +25 -6
  14. data/lib/when_exe/{region → ephemeris}/planets.rb +0 -0
  15. data/lib/when_exe/{region → ephemeris}/sun.rb +7 -3
  16. data/lib/when_exe/{region → ephemeris}/v50.rb +0 -0
  17. data/lib/when_exe/googlecalendar.rb +2 -2
  18. data/lib/when_exe/icalendar.rb +3 -3
  19. data/lib/when_exe/inspect.rb +130 -70
  20. data/lib/when_exe/locales/af.rb +2 -2
  21. data/lib/when_exe/locales/akt.rb +176 -0
  22. data/lib/when_exe/locales/ar.rb +2 -2
  23. data/lib/when_exe/locales/{locales.rb → autoload.rb} +6 -2
  24. data/lib/when_exe/locales/az.rb +2 -2
  25. data/lib/when_exe/locales/bg.rb +2 -2
  26. data/lib/when_exe/locales/bn.rb +2 -2
  27. data/lib/when_exe/locales/bs.rb +2 -2
  28. data/lib/when_exe/locales/ca.rb +2 -2
  29. data/lib/when_exe/locales/cs.rb +2 -2
  30. data/lib/when_exe/locales/cy.rb +2 -2
  31. data/lib/when_exe/locales/da.rb +2 -2
  32. data/lib/when_exe/locales/de.rb +2 -2
  33. data/lib/when_exe/locales/de_AT.rb +2 -2
  34. data/lib/when_exe/locales/de_CH.rb +2 -2
  35. data/lib/when_exe/locales/el.rb +2 -2
  36. data/lib/when_exe/locales/en.rb +2 -2
  37. data/lib/when_exe/locales/en_AU.rb +2 -2
  38. data/lib/when_exe/locales/en_CA.rb +2 -2
  39. data/lib/when_exe/locales/en_GB.rb +2 -2
  40. data/lib/when_exe/locales/en_IE.rb +2 -2
  41. data/lib/when_exe/locales/en_IN.rb +3 -3
  42. data/lib/when_exe/locales/en_NZ.rb +2 -2
  43. data/lib/when_exe/locales/en_US.rb +2 -2
  44. data/lib/when_exe/locales/en_ZA.rb +88 -0
  45. data/lib/when_exe/locales/encoding_conversion.rb +126 -0
  46. data/lib/when_exe/locales/eo.rb +2 -2
  47. data/lib/when_exe/locales/es.rb +2 -2
  48. data/lib/when_exe/locales/es_419.rb +2 -2
  49. data/lib/when_exe/locales/es_AR.rb +2 -2
  50. data/lib/when_exe/locales/es_CL.rb +2 -2
  51. data/lib/when_exe/locales/es_CO.rb +2 -2
  52. data/lib/when_exe/locales/es_CR.rb +2 -2
  53. data/lib/when_exe/locales/es_EC.rb +2 -2
  54. data/lib/when_exe/locales/es_MX.rb +2 -2
  55. data/lib/when_exe/locales/es_PA.rb +2 -2
  56. data/lib/when_exe/locales/es_PE.rb +2 -2
  57. data/lib/when_exe/locales/es_US.rb +84 -0
  58. data/lib/when_exe/locales/es_VE.rb +2 -2
  59. data/lib/when_exe/locales/et.rb +2 -2
  60. data/lib/when_exe/locales/eu.rb +2 -2
  61. data/lib/when_exe/locales/fa.rb +2 -2
  62. data/lib/when_exe/locales/fi.rb +3 -3
  63. data/lib/when_exe/locales/fr.rb +2 -2
  64. data/lib/when_exe/locales/fr_CA.rb +2 -2
  65. data/lib/when_exe/locales/fr_CH.rb +2 -2
  66. data/lib/when_exe/locales/gl.rb +2 -2
  67. data/lib/when_exe/locales/he.rb +3 -3
  68. data/lib/when_exe/locales/hi.rb +2 -2
  69. data/lib/when_exe/locales/hi_IN.rb +2 -2
  70. data/lib/when_exe/locales/hr.rb +2 -2
  71. data/lib/when_exe/locales/hu.rb +6 -5
  72. data/lib/when_exe/locales/iast.rb +90 -0
  73. data/lib/when_exe/locales/id.rb +2 -2
  74. data/lib/when_exe/locales/is.rb +2 -2
  75. data/lib/when_exe/locales/it.rb +2 -2
  76. data/lib/when_exe/locales/it_CH.rb +2 -2
  77. data/lib/when_exe/locales/ja.rb +2 -2
  78. data/lib/when_exe/locales/kn.rb +2 -2
  79. data/lib/when_exe/locales/ko.rb +2 -2
  80. data/lib/when_exe/locales/links.rb +3 -3
  81. data/lib/when_exe/locales/lo.rb +2 -2
  82. data/lib/when_exe/{parts → locales}/locale.rb +77 -49
  83. data/lib/when_exe/locales/lt.rb +6 -2
  84. data/lib/when_exe/locales/lv.rb +2 -2
  85. data/lib/when_exe/locales/mk.rb +2 -2
  86. data/lib/when_exe/locales/mn.rb +2 -2
  87. data/lib/when_exe/locales/ms.rb +2 -2
  88. data/lib/when_exe/locales/nb.rb +2 -2
  89. data/lib/when_exe/locales/ne.rb +2 -2
  90. data/lib/when_exe/locales/nl.rb +2 -2
  91. data/lib/when_exe/locales/nn.rb +2 -2
  92. data/lib/when_exe/locales/or.rb +2 -2
  93. data/lib/when_exe/locales/pl.rb +2 -2
  94. data/lib/when_exe/locales/pt.rb +2 -2
  95. data/lib/when_exe/locales/pt_BR.rb +2 -2
  96. data/lib/when_exe/locales/rm.rb +2 -2
  97. data/lib/when_exe/locales/ro.rb +2 -2
  98. data/lib/when_exe/locales/ru.rb +2 -2
  99. data/lib/when_exe/locales/sk.rb +2 -2
  100. data/lib/when_exe/locales/sl.rb +2 -2
  101. data/lib/when_exe/locales/sr.rb +2 -2
  102. data/lib/when_exe/locales/sv.rb +2 -2
  103. data/lib/when_exe/locales/sw.rb +2 -2
  104. data/lib/when_exe/locales/ta.rb +95 -0
  105. data/lib/when_exe/locales/th.rb +2 -2
  106. data/lib/when_exe/locales/tl.rb +3 -3
  107. data/lib/when_exe/locales/tr.rb +2 -2
  108. data/lib/when_exe/locales/transliteration_table.rb +62 -0
  109. data/lib/when_exe/locales/uk.rb +15 -15
  110. data/lib/when_exe/locales/ur.rb +2 -2
  111. data/lib/when_exe/locales/uz.rb +2 -2
  112. data/lib/when_exe/locales/vi.rb +2 -2
  113. data/lib/when_exe/locales/wo.rb +2 -2
  114. data/lib/when_exe/locales/zh_CN.rb +2 -2
  115. data/lib/when_exe/locales/zh_HK.rb +15 -15
  116. data/lib/when_exe/locales/zh_TW.rb +2 -2
  117. data/lib/when_exe/locales/zh_YUE.rb +77 -0
  118. data/lib/when_exe/mini_application.rb +22 -12
  119. data/lib/when_exe/parts/geometric_complex.rb +16 -1
  120. data/lib/when_exe/parts/method_cash.rb +184 -238
  121. data/lib/when_exe/parts/resource.rb +65 -16
  122. data/lib/when_exe/region/armenian.rb +56 -0
  123. data/lib/when_exe/region/bahai.rb +13 -13
  124. data/lib/when_exe/region/balinese.rb +33 -35
  125. data/lib/when_exe/region/chinese.rb +82 -78
  126. data/lib/when_exe/region/{chinese_calendar.rb → chinese/calendars.rb} +59 -40
  127. data/lib/when_exe/region/{chinese_epoch.rb → chinese/epochs.rb} +3 -4
  128. data/lib/when_exe/region/{chinese_twin.rb → chinese/twins.rb} +48 -51
  129. data/lib/when_exe/region/christian.rb +236 -127
  130. data/lib/when_exe/region/coptic.rb +9 -10
  131. data/lib/when_exe/region/dee.rb +48 -0
  132. data/lib/when_exe/region/discordian.rb +225 -0
  133. data/lib/when_exe/region/far_east.rb +2 -6
  134. data/lib/when_exe/region/french.rb +7 -17
  135. data/lib/when_exe/region/geologicalage.rb +0 -1
  136. data/lib/when_exe/region/goddess.rb +58 -0
  137. data/lib/when_exe/region/indian.rb +323 -231
  138. data/lib/when_exe/region/iranian.rb +159 -22
  139. data/lib/when_exe/region/islamic.rb +7 -9
  140. data/lib/when_exe/region/japanese.rb +14 -803
  141. data/lib/when_exe/region/japanese/calendars.rb +397 -0
  142. data/lib/when_exe/region/japanese/epochs.rb +426 -0
  143. data/lib/when_exe/region/{nihon_shoki.rb → japanese/nihon_shoki.rb} +0 -2
  144. data/lib/when_exe/region/{japanese_notes.rb → japanese/notes.rb} +179 -150
  145. data/lib/when_exe/region/japanese/residues.rb +1306 -0
  146. data/lib/when_exe/region/{japanese_twin.rb → japanese/twins.rb} +12 -15
  147. data/lib/when_exe/region/javanese.rb +16 -14
  148. data/lib/when_exe/region/jewish.rb +8 -9
  149. data/lib/when_exe/region/korean.rb +146 -35
  150. data/lib/when_exe/region/m17n.rb +8 -10
  151. data/lib/when_exe/region/martian.rb +44 -16
  152. data/lib/when_exe/region/mayan.rb +12 -10
  153. data/lib/when_exe/region/pope.rb +0 -1
  154. data/lib/when_exe/region/residue.rb +4 -5
  155. data/lib/when_exe/region/roman.rb +20 -24
  156. data/lib/when_exe/region/ryukyu.rb +3 -4
  157. data/lib/when_exe/region/shire.rb +97 -94
  158. data/lib/when_exe/region/symmetry.rb +50 -0
  159. data/lib/when_exe/region/thai.rb +164 -56
  160. data/lib/when_exe/region/tibetan.rb +86 -86
  161. data/lib/when_exe/region/vietnamese.rb +9 -12
  162. data/lib/when_exe/region/weekdate.rb +80 -0
  163. data/lib/when_exe/region/world.rb +65 -70
  164. data/lib/when_exe/region/yerm.rb +98 -0
  165. data/lib/when_exe/region/zoroastrian.rb +203 -0
  166. data/lib/when_exe/timestandard.rb +4 -4
  167. data/lib/when_exe/tmobjects.rb +1 -3
  168. data/lib/when_exe/tmposition.rb +13 -12
  169. data/lib/when_exe/tmreference.rb +11 -10
  170. data/lib/when_exe/version.rb +1 -1
  171. data/link_to_online_documents +3 -3
  172. data/test/examples/Residue.m17n +1 -1
  173. data/test/examples/Terms.m17n +1 -1
  174. data/test/test.rb +2 -1
  175. data/test/test/basictypes.rb +18 -2
  176. data/test/test/calendarnote.rb +1 -1
  177. data/test/test/calendartypes.rb +1 -1
  178. data/test/test/coordinates.rb +7 -7
  179. data/test/test/{region → ephemeris}/moon.rb +0 -0
  180. data/test/test/{region → ephemeris}/planets.rb +0 -0
  181. data/test/test/{region → ephemeris}/sun.rb +0 -0
  182. data/test/test/parts.rb +8 -13
  183. data/test/test/region/christian.rb +245 -0
  184. data/test/test/region/french.rb +16 -16
  185. data/test/test/region/iran.rb +34 -34
  186. data/test/test/region/japanese.rb +6 -4
  187. data/test/test/region/m17n.rb +8 -7
  188. data/test/test/region/mayan.rb +12 -12
  189. data/test/test/region/residue.rb +20 -4
  190. data/test/test/region/thai.rb +25 -3
  191. data/test/test/region/yerm.rb +146 -0
  192. metadata +39 -20
  193. data/lib/when_exe/region/japanese_residues.rb +0 -1212
  194. data/test/test/region/civil.rb +0 -124
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/ne.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/nl.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/nn.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/or.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/pl.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/pt.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/pt-BR.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/rm.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/ro.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/ru.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/sk.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/sl.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/sr.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/sv.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/sw.yml
12
12
 
@@ -0,0 +1,95 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ Copyright (C) 2012-2014 Takashi SUGA
4
+
5
+ You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
+ =end
7
+
8
+ module When
9
+ module Locale
10
+
11
+ # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/ta.yml
12
+
13
+ Locale_ta =
14
+ {"date"=>
15
+ {"abbr_day_names"=>
16
+ ["ஞாயிறு", "திங்கள்", "செவ்வாய்", "புதன்", "வியாழன்", "வெள்ளி", "சனி"],
17
+ "abbr_month_names"=>
18
+ [nil,
19
+ "ஜன",
20
+ "பிப்",
21
+ "மார்ச்",
22
+ "ஏப்",
23
+ "மே",
24
+ "ஜூன்",
25
+ "ஜூலை",
26
+ "ஆக",
27
+ "செப்",
28
+ "அக்",
29
+ "நவ",
30
+ "டிச"],
31
+ "day_names"=>
32
+ ["ஞாயிற்றுக்கிழமை",
33
+ "திங்கட்கிழமை",
34
+ "செவ்வாய்க்கிழமை",
35
+ "புதன்கிழமை",
36
+ "வியாழக்கிழமை",
37
+ "வெள்ளிக்கிழமை",
38
+ "சனிக்கிழமை"],
39
+ "formats"=>{"default"=>"%d-%m-%Y", "long"=>"%B %d, %Y", "short"=>"%b %d"},
40
+ "month_names"=>
41
+ [nil,
42
+ "ஜனவரி",
43
+ "பிப்ரவரி",
44
+ "மார்ச்",
45
+ "ஏப்ரல்",
46
+ "மே",
47
+ "ஜூன்",
48
+ "ஜூலை",
49
+ "ஆகஸ்ட்",
50
+ "செப்டம்பர்",
51
+ "அக்டோபர்",
52
+ "நவம்பர்",
53
+ "டிசம்பர்"],
54
+ "order"=>[:day, :month, :year]},
55
+ "time"=>
56
+ {"am"=>"மு.ப.",
57
+ "formats"=>
58
+ {"default"=>"%a, %d %b %Y %H:%M:%S %z",
59
+ "long"=>"%B %d, %Y %H:%M",
60
+ "short"=>"%d %b %H:%M",
61
+ "time"=>"%H:%M:%S %z"},
62
+ "pm"=>"பி.ப."},
63
+ "datetime"=>
64
+ {"distance_in_words"=>
65
+ {"about_x_hours"=>
66
+ {"one"=>"சுமார் 1 மணி நேரம்", "other"=>"சுமார் %{count} மணி"},
67
+ "about_x_months"=>
68
+ {"one"=>"சுமார் 1 மாதம்", "other"=>"சுமார் %{count} மாதங்களுக்கு"},
69
+ "about_x_years"=>
70
+ {"one"=>"சுமார் 1 ஆண்டு", "other"=>"சுமார் %{count} ஆண்டுகள்"},
71
+ "almost_x_years"=>
72
+ {"one"=>"கிட்டத்தட்ட 1 ஆண்டு",
73
+ "other"=>"கிட்டத்தட்ட %{count} ஆண்டுகள்"},
74
+ "half_a_minute"=>"அரை நிமிடம்",
75
+ "less_than_x_minutes"=>
76
+ {"one"=>"ஒரு நிமிடத்திற்கும் குறைவாக",
77
+ "other"=>"குறைவாக %{count} நிமிடங்கள்"},
78
+ "less_than_x_seconds"=>
79
+ {"one"=>"ஒரு வினாடிக்கும் குறைவாக",
80
+ "other"=>"குறைவாக %{count} வினாடிகள்"},
81
+ "over_x_years"=>
82
+ {"one"=>"ஒரு ஆண்டிற்கு மேலாக", "other"=>"%{count} ஆண்டிற்கு மேலாக"},
83
+ "x_days"=>{"one"=>"1 நாள்", "other"=>"%{count} நாட்கள்"},
84
+ "x_minutes"=>{"one"=>"1 நிமிடம்", "other"=>"%{count} நிமிடங்கள்"},
85
+ "x_months"=>{"one"=>"1 மாதம்", "other"=>"%{count} மாதங்கள்"},
86
+ "x_seconds"=>{"one"=>"1 வினாடி", "other"=>"%{count} விநாடிகள்"}},
87
+ "prompts"=>
88
+ {"day"=>"நாள்",
89
+ "hour"=>"மணி",
90
+ "minute"=>"நிமிடம்",
91
+ "month"=>"மாதம்",
92
+ "second"=>"விநாடிகள்",
93
+ "year"=>"ஆண்டு"}}}
94
+ end
95
+ end
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/th.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/tl.yml
12
12
 
@@ -80,7 +80,7 @@ module When::BasicTypes
80
80
  "about_x_months"=>
81
81
  {"one"=>"humigit-kumulang isang buwan",
82
82
  "other"=>"humigit-kumulang %{count} buwan"},
83
- "x_months"=>{"one"=>"isang buwan", "other"=>"%{count} buwang"},
83
+ "x_months"=>{"one"=>"isang buwan", "other"=>"%{count} buwan"},
84
84
  "about_x_years"=>
85
85
  {"one"=>"humigit-kumulang isang taon",
86
86
  "other"=>"humigit-kumulang %{count} taon"},
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/tr.yml
12
12
 
@@ -0,0 +1,62 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ Copyright (C) 2014 Takashi SUGA
4
+
5
+ You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
+ =end
7
+
8
+ module When
9
+ module Locale
10
+ class << self
11
+
12
+ #
13
+ # Generate Regexp for transliteration
14
+ #
15
+ # @param [Hash] hash transliteration table
16
+ #
17
+ # @return [Regexp] Regexp for transliteration
18
+ #
19
+ def transliteration_keys(hash)
20
+ Regexp.new((hash.keys.sort_by {|key| -key.length} + ['%.*?[A-Za-z]']).join('|'))
21
+ end
22
+
23
+ #
24
+ # Generate Hash of {locale=>Regexp} for transliteration
25
+ #
26
+ # @param [Hash] hash transliteration table hash
27
+ #
28
+ # @return [Hash{String=>Regexp}] Hash of {locale=>Regexp} for transliteration
29
+ #
30
+ def transliteration_keys_hash(hash)
31
+ Hash[*(hash.keys.map {|locale|
32
+ [locale, transliteration_keys(hash[locale])]
33
+ }).flatten]
34
+ end
35
+
36
+ alias :_method_missing :method_missing
37
+
38
+ #
39
+ # �ϊ����\�b�h�̓o�^
40
+ #
41
+ def method_missing(name, *args, &block)
42
+ table_name = name.to_s.upcase
43
+ return _method_missing(name, *args, &block) unless table_name !~ /_/ && const_defined?(table_name)
44
+ table_obj = const_get(table_name)
45
+ default = table_obj.keys.first
46
+ locale = args[1] || default
47
+ const_set(table_name + '_keys', transliteration_keys_hash(table_obj)) unless const_defined?(table_name + '_keys')
48
+ return send(name, args[0], locale) if respond_to?(name)
49
+ instance_eval %Q{
50
+ def #{name}(string, locale='#{default}')
51
+ string.gsub(#{table_name}_keys[locale]) do |code|
52
+ #{table_name}[locale][code] || code
53
+ end
54
+ end
55
+ }
56
+ args[0].gsub(const_get("#{table_name}_keys")[locale]) do |code|
57
+ table_obj[locale][code] || code
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/uk.yml
12
12
 
@@ -35,21 +35,21 @@ module When::BasicTypes
35
35
  "четвер",
36
36
  "п'ятниця",
37
37
  "субота"],
38
- "formats"=>{"default"=>"%d.%m.%Y", "long"=>"%-d %B %Y", "short"=>"%-d %b"},
38
+ "formats"=>{"default"=>"%d.%m.%Y", "long"=>"%d %B %Y", "short"=>"%d %b"},
39
39
  "month_names"=>
40
40
  [nil,
41
- "Січень",
42
- "Лютий",
43
- "Березень",
44
- "Квітень",
45
- "Травень",
46
- "Червень",
47
- "Липень",
48
- "Серпень",
49
- "Вересень",
50
- "Жовтень",
51
- "Листопад",
52
- "Грудень"],
41
+ "Січня",
42
+ "Лютого",
43
+ "Березня",
44
+ "Квітня",
45
+ "Травня",
46
+ "Червня",
47
+ "Липня",
48
+ "Серпня",
49
+ "Вересня",
50
+ "Жовтня",
51
+ "Листопада",
52
+ "Грудня"],
53
53
  "order"=>[:day, :month, :year]},
54
54
  "time"=>
55
55
  {"am"=>"до полудня",
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/ur.yml
12
12
 
@@ -5,8 +5,8 @@
5
5
  You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
6
6
  =end
7
7
 
8
- module When::BasicTypes
9
- class M17n
8
+ module When
9
+ module Locale
10
10
 
11
11
  # from https://raw.github.com/svenfuchs/rails-i18n/master/rails/locale/uz.yml
12
12