r18n-core 1.1.11 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +4 -0
  3. data/README.md +2 -2
  4. data/lib/r18n-core/filter_list.rb +2 -3
  5. data/lib/r18n-core/filters.rb +9 -10
  6. data/lib/r18n-core/helpers.rb +0 -1
  7. data/lib/r18n-core/i18n.rb +1 -2
  8. data/lib/r18n-core/locale.rb +10 -12
  9. data/lib/r18n-core/translated.rb +3 -4
  10. data/lib/r18n-core/translated_string.rb +0 -1
  11. data/lib/r18n-core/translation.rb +2 -3
  12. data/lib/r18n-core/unsupported_locale.rb +0 -1
  13. data/lib/r18n-core/untranslated.rb +0 -1
  14. data/lib/r18n-core/utils.rb +0 -11
  15. data/lib/r18n-core/version.rb +1 -2
  16. data/lib/r18n-core/yaml_loader.rb +0 -1
  17. data/lib/r18n-core/yaml_methods.rb +2 -8
  18. data/lib/r18n-core.rb +0 -3
  19. data/locales/bg.rb +11 -13
  20. data/locales/ca.rb +13 -14
  21. data/locales/cs.rb +15 -16
  22. data/locales/da.rb +13 -15
  23. data/locales/de.rb +14 -15
  24. data/locales/en-au.rb +2 -2
  25. data/locales/en-gb.rb +2 -2
  26. data/locales/en-us.rb +5 -7
  27. data/locales/en.rb +14 -14
  28. data/locales/eo.rb +11 -12
  29. data/locales/es-us.rb +6 -8
  30. data/locales/es.rb +11 -12
  31. data/locales/fi.rb +16 -17
  32. data/locales/fr.rb +10 -11
  33. data/locales/gl.rb +12 -13
  34. data/locales/hr.rb +12 -13
  35. data/locales/hu.rb +12 -13
  36. data/locales/id.rb +9 -9
  37. data/locales/it.rb +9 -10
  38. data/locales/ja.rb +11 -12
  39. data/locales/kk.rb +16 -18
  40. data/locales/lv.rb +16 -17
  41. data/locales/mn.rb +12 -14
  42. data/locales/nb.rb +12 -13
  43. data/locales/nl.rb +13 -14
  44. data/locales/no.rb +12 -13
  45. data/locales/pl.rb +13 -14
  46. data/locales/pt-br.rb +2 -3
  47. data/locales/pt.rb +13 -14
  48. data/locales/ru.rb +14 -15
  49. data/locales/sk.rb +15 -16
  50. data/locales/sr-latn.rb +12 -14
  51. data/locales/sv-se.rb +11 -13
  52. data/locales/th.rb +13 -14
  53. data/locales/tr.rb +12 -15
  54. data/locales/uk.rb +11 -15
  55. data/locales/zh-cn.rb +2 -3
  56. data/locales/zh-tw.rb +5 -6
  57. data/locales/zh.rb +10 -11
  58. data/r18n-core.gemspec +5 -4
  59. data/spec/filters_spec.rb +94 -91
  60. data/spec/i18n_spec.rb +66 -68
  61. data/spec/locale_spec.rb +74 -74
  62. data/spec/locales/cs_spec.rb +14 -14
  63. data/spec/locales/en-us_spec.rb +6 -6
  64. data/spec/locales/en_spec.rb +6 -6
  65. data/spec/locales/fr_spec.rb +2 -2
  66. data/spec/locales/hu_spec.rb +6 -7
  67. data/spec/locales/it_spec.rb +3 -4
  68. data/spec/locales/pl_spec.rb +14 -14
  69. data/spec/locales/ru_spec.rb +13 -13
  70. data/spec/locales/sk_spec.rb +14 -14
  71. data/spec/locales/th_spec.rb +2 -2
  72. data/spec/r18n_spec.rb +47 -49
  73. data/spec/spec_helper.rb +0 -7
  74. data/spec/translated_spec.rb +26 -28
  75. data/spec/translation_spec.rb +38 -40
  76. data/spec/yaml_loader_spec.rb +14 -16
  77. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b47c07c8bd6ee5322233ea9ab8fd2e6f62096a06
4
- data.tar.gz: 72b876e87382bc4132952244b0dfe0083a9d91b0
3
+ metadata.gz: b02d3737730702d611d4ae58c955c6a8ada010ec
4
+ data.tar.gz: 6cd70b7df39a5d1e88e7931d9987d3b81cae309c
5
5
  SHA512:
6
- metadata.gz: a0e8a7e05839673279849b8bb25d93fe9c7df0fe96232a22a87b711c0db544fbe57e7da969482c4e6c21197730cca31fbd75a38bb511654c12a076a712dd1974
7
- data.tar.gz: 49db67bdbfbaf93250812bf283ae59e7f36a5a5203a476f0009275dcf48dec6102773df063e4e8af68d996da5286d80e2cfbcf70b887bfcde42afc6fcc7674d4
6
+ metadata.gz: 7d9c896e1da05e05b004070f78ca2f659216e13b3d4c14e9fb3b6deefab72ed3c950eb3e3d08d7d38dd62edf159c7294047e4d561c21de624734e78f3a710772
7
+ data.tar.gz: de05088818bf8af4f7919323cb73db54b7b3dc2283b257f961303d972f8ae1bafdbf8fd0395ce86616576d812e83025a23bcea3e8a6a98e997483e76c7e5bbc7
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.0.0 (Москва)
2
+ * Remove Ruby 1.8 and 1.9 support.
3
+ * Add JRuby 9000 support.
4
+
1
5
  ### 1.1.11 (São Paulo)
2
6
  * Allow to set Proc as `default` option in Rails I18n backend.
3
7
 
data/README.md CHANGED
@@ -194,7 +194,7 @@ To create a filter you pass the following to `R18n::Filters.add`:
194
194
  `R18n::Filters.off`, `R18n::Filters.on` and
195
195
  `R18n::Filters.delete`.
196
196
  * Hash with options:
197
- * `:passive => true` to filter translations only on load;
197
+ * `passive: true` to filter translations only on load;
198
198
  * `:position` within the list of current filters of this type
199
199
  (by default a new filter will be inserted into last position).
200
200
 
@@ -261,7 +261,7 @@ to use your own parser:
261
261
  # Disable standard Markdown filter
262
262
  Filters.off(:kramdown)
263
263
  # Add new filter for !!markdown YAML type
264
- Filters.add('markdown', :passive => true) do |content, config|
264
+ Filters.add('markdown', passive: true) do |content, config|
265
265
  require 'redcarpet'
266
266
  markdown = ::Redcarpet::Markdown.new(Redcarpet::Render::HTML)
267
267
  markdown.render(content)
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Filters for translations content.
4
3
 
@@ -24,7 +23,7 @@ module R18n
24
23
  class FilterList
25
24
  # Process +value+ by filters in +enabled+.
26
25
  def process(filters_type, type, value, locale, path, params)
27
- config = { :locale => locale, :path => path }
26
+ config = { locale: locale, path: path }
28
27
 
29
28
  enabled(filters_type, type).each do |filter|
30
29
  value = filter.call(value, config, *params)
@@ -51,7 +50,7 @@ module R18n
51
50
  # Process +value+ by global filters in +enabled+.
52
51
  def process_string(filters_type, value, config, params)
53
52
  if config.is_a? String
54
- config = { :locale => value.locale, :path => config }
53
+ config = { locale: value.locale, path: config }
55
54
  end
56
55
  enabled(filters_type, String).each do |f|
57
56
  value = f.call(value, config, *params)
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Filters for translations content.
4
3
 
@@ -36,7 +35,7 @@ module R18n
36
35
  # R18n::Filters.add('custom_type', :no_space) do |content, config, replace|
37
36
  # content.gsub(' ', replace)
38
37
  # end
39
- # R18n::Filters.add('custom_type', :passive => true) do |content, config|
38
+ # R18n::Filters.add('custom_type', passive: true) do |content, config|
40
39
  # content + '!'
41
40
  # end
42
41
  #
@@ -76,8 +75,8 @@ module R18n
76
75
  #
77
76
  # You can enabled/disabled filters only for special I18n object:
78
77
  #
79
- # R18n::I18n.new('en', nil, :on_filters => [:untranslated_html, :no_space],
80
- # :off_filters => :untranslated )
78
+ # R18n::I18n.new('en', nil, on_filters: [:untranslated_html, :no_space],
79
+ # off_filters: :untranslated )
81
80
  module Filters
82
81
  class << self
83
82
  # Hash of filter names to Filters.
@@ -225,7 +224,7 @@ module R18n
225
224
  content[type]
226
225
  else
227
226
  UnpluralizetedTranslation.new(config[:locale], config[:path],
228
- :locale => config[:locale], :translations => content)
227
+ locale: config[:locale], translations: content)
229
228
  end
230
229
  end
231
230
 
@@ -270,18 +269,18 @@ module R18n
270
269
  end
271
270
  Filters.off(:untranslated_html)
272
271
 
273
- Filters.add('escape', :escape_html, :passive => true) do |content, config|
272
+ Filters.add('escape', :escape_html, passive: true) do |content, config|
274
273
  config[:dont_escape_html] = true
275
274
  Utils.escape_html(content)
276
275
  end
277
276
 
278
- Filters.add('html', :dont_escape_html, :passive => true) do |content, config|
277
+ Filters.add('html', :dont_escape_html, passive: true) do |content, config|
279
278
  config[:dont_escape_html] = true
280
279
  content
281
280
  end
282
281
 
283
282
  Filters.add([String, 'markdown', 'textile'],
284
- :global_escape_html, :passive => true) do |html, config|
283
+ :global_escape_html, passive: true) do |html, config|
285
284
  if config[:dont_escape_html]
286
285
  html
287
286
  else
@@ -291,12 +290,12 @@ module R18n
291
290
  end
292
291
  Filters.off(:global_escape_html)
293
292
 
294
- Filters.add('markdown', :kramdown, :passive => true) do |content, config|
293
+ Filters.add('markdown', :kramdown, passive: true) do |content, config|
295
294
  require 'kramdown'
296
295
  ::Kramdown::Document.new(content).to_html
297
296
  end
298
297
 
299
- Filters.add('textile', :redcloth, :passive => true) do |content, config|
298
+ Filters.add('textile', :redcloth, passive: true) do |content, config|
300
299
  require 'redcloth'
301
300
  ::RedCloth.new(content).to_html
302
301
  end
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Mixin with common methods.
4
3
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  I18n support.
4
3
 
@@ -226,7 +225,7 @@ module R18n
226
225
  end
227
226
  end
228
227
 
229
- @translation = Translation.new(@locale, '', :filters => @filters)
228
+ @translation = Translation.new(@locale, '', filters: @filters)
230
229
  @locales.each do |locale|
231
230
  loaded = false
232
231
  available_in_places.each do |place, available|
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Locale to i18n support.
4
3
 
@@ -92,8 +91,8 @@ module R18n
92
91
  # name, which return propetry value:
93
92
  #
94
93
  # class R18n::Locales::En < R18n::Locale
95
- # set :title => 'English',
96
- # :code => 'en'
94
+ # set title: 'English',
95
+ # code: 'en'
97
96
  # end
98
97
  #
99
98
  # locale = R18n::Locales::En.new
@@ -112,13 +111,13 @@ module R18n
112
111
  lang.downcase + (culture ? '-' + culture.upcase : '')
113
112
  end
114
113
 
115
- set :sublocales => %w{en},
116
- :week_start => :monday,
117
- :time_am => 'AM',
118
- :time_pm => 'PM',
119
- :time_format => ' %H:%M',
120
- :full_format => '%e %B',
121
- :year_format => '_ %Y'
114
+ set sublocales: %w{en},
115
+ week_start: :monday,
116
+ time_am: 'AM',
117
+ time_pm: 'PM',
118
+ time_format: ' %H:%M',
119
+ full_format: '%e %B',
120
+ year_format: '_ %Y'
122
121
 
123
122
  def month_standalone; month_names; end
124
123
  def month_abbrs; month_names; end
@@ -228,8 +227,7 @@ module R18n
228
227
  minutes = (time - now) / 60.0
229
228
  diff = minutes.abs
230
229
  if (diff > 24 * 60) or (time.mday != now.mday and diff > 12 * 24)
231
- format_date_human(R18n::Utils.to_date(time), i18n,
232
- R18n::Utils.to_date(now)) + format_time(time)
230
+ format_date_human(time.to_date, i18n, now.to_date) + format_time(time)
233
231
  else
234
232
  if -1 < minutes and 1 > minutes
235
233
  i18n.human_time.now
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Add i18n support to any class.
4
3
 
@@ -75,7 +74,7 @@ module R18n
75
74
  #
76
75
  # Method +translation+ will be more useful for options:
77
76
  #
78
- # translation :title, :methods => {:ru => :russian, :en => :english}
77
+ # translation :title, methods: { ru: :russian, en: :english}
79
78
  module Translated
80
79
  class << self
81
80
  def included(base) #:nodoc:
@@ -100,7 +99,7 @@ module R18n
100
99
  # Add several proxy +methods+. See R18n::Translated for description.
101
100
  # It’s more compact, that +translation+.
102
101
  #
103
- # translations :title, :keywords, [:desciption, {:type => 'markdown'}]
102
+ # translations :title, :keywords, [:desciption, { type: 'markdown' }]
104
103
  def translations(*methods)
105
104
  methods.each do |method|
106
105
  translation(*method)
@@ -110,7 +109,7 @@ module R18n
110
109
  # Add proxy-method +name+. See R18n::Translated for description.
111
110
  # It’s more useful to set options.
112
111
  #
113
- # translation :desciption, :type => 'markdown'
112
+ # translation :desciption, type: 'markdown'
114
113
  def translation(name, options = {})
115
114
  if options[:methods]
116
115
  @unlocalized_getters[name] = R18n::Utils.
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Translation string for i18n support.
4
3
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Translation to i18n support.
4
3
 
@@ -90,9 +89,9 @@ module R18n
90
89
  case value
91
90
  when Hash
92
91
  value = Translation.new(@locale, path,
93
- :locale => locale, :translations => value, :filters => @filters)
92
+ locale: locale, translations: value, filters: @filters)
94
93
  when String
95
- c = { :locale => locale, :path => path }
94
+ c = { locale: locale, path: path }
96
95
  v = @filters.process_string(:passive, value, c, [])
97
96
  value = TranslatedString.new(v, locale, path, @filters)
98
97
  when Typed
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Locale withou information file to i18n support.
4
3
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Untranslation string for i18n support.
4
3
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Common methods for i18n support.
4
3
 
@@ -21,16 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21
20
  # Common methods for another R18n code.
22
21
  module R18n
23
22
  module Utils
24
- # Convert Time to Date. Backport from Ruby 1.9.
25
- def self.to_date(time)
26
- if '1.8.' == RUBY_VERSION[0..3]
27
- d = Date.send(:civil_to_jd, time.year, time.mon, time.mday, Date::ITALY)
28
- Date.new!(Date.send(:jd_to_ajd, d, 0, 0), 0, Date::ITALY)
29
- else
30
- time.to_date
31
- end
32
- end
33
-
34
23
  HTML_ENTRIES = { '&' => '&amp;', '<' => '&lt;', '>' => '&gt;' }
35
24
 
36
25
  # Escape HTML entries (<, >, &). Copy from HAML helper.
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  module R18n
3
- VERSION = '1.1.11'.freeze unless defined? R18n::VERSION
2
+ VERSION = '2.0.0'.freeze unless defined? R18n::VERSION
4
3
  end
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Loader for YAML translations.
4
3
 
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Base methods to load translations for YAML.
4
3
 
@@ -19,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19
18
  =end
20
19
 
21
20
  require 'yaml'
22
- require 'yecht' if RUBY_PLATFORM == 'java'
23
21
 
24
22
  module R18n
25
23
  # Base methods to load translations for YAML.
@@ -27,18 +25,14 @@ module R18n
27
25
  module YamlMethods
28
26
  # Detect class for private type depend on YAML parser.
29
27
  def detect_yaml_private_type
30
- @private_type_class = if defined?(JRUBY_VERSION)
31
- ::YAML::Yecht::PrivateType
32
- elsif '1.8.' == RUBY_VERSION[0..3]
33
- ::YAML::PrivateType
34
- elsif 'syck' == ::YAML::ENGINE.yamler
28
+ @private_type_class = if defined?(Syck)
35
29
  ::Syck::PrivateType
36
30
  end
37
31
  end
38
32
 
39
33
  # Register global types in Psych
40
34
  def initialize_types
41
- if '1.8.' != RUBY_VERSION[0..3] and 'psych' == ::YAML::ENGINE.yamler
35
+ if defined?(Psych)
42
36
  Filters.by_type.keys.each do |type|
43
37
  next unless type.is_a? String
44
38
  # Yeah, I add R18n’s types to global, send me patch if you really
data/lib/r18n-core.rb CHANGED
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  =begin
3
2
  Main file to load all neccessary classes for i18n support.
4
3
 
@@ -18,8 +17,6 @@ You should have received a copy of the GNU Lesser General Public License
18
17
  along with this program. If not, see <http://www.gnu.org/licenses/>.
19
18
  =end
20
19
 
21
- $KCODE = 'u' if '1.8.' == RUBY_VERSION[0..3]
22
-
23
20
  require 'pathname'
24
21
 
25
22
  dir = Pathname(__FILE__).dirname.expand_path + 'r18n-core'
data/locales/bg.rb CHANGED
@@ -1,20 +1,18 @@
1
- # encoding: utf-8
2
1
  module R18n
3
2
  class Locales::Bg < Locale
4
- set :title => 'Български',
3
+ set title: 'Български',
5
4
 
6
- :wday_names => %w{Неделя Понеделник Вторник Сряда Четвъртък Петък
7
- Събота},
8
- :wday_abbrs => %w{Нед Пон Вто Сря Чет Пет Съб},
5
+ wday_names: %w{Неделя Понеделник Вторник Сряда Четвъртък Петък Събота},
6
+ wday_abbrs: %w{Нед Пон Вто Сря Чет Пет Съб},
9
7
 
10
- :month_names => %w{Януари Февруари Март Април Май Юни Юли Август
11
- Септември Октомври Ноември Декември},
12
- :month_abbrs => %w{Яну Фев Мар Апр Май Юни Юли Авг Сеп Окт Ное Дек},
13
- :month_standalone => %w{Януари Февруари Март Април Май Юни Юли Август
14
- Септември Октомври Ноември Декември},
15
- :date_format => '%d.%m.%Y',
8
+ month_names: %w{Януари Февруари Март Април Май Юни Юли Август
9
+ Септември Октомври Ноември Декември},
10
+ month_abbrs: %w{Яну Фев Мар Апр Май Юни Юли Авг Сеп Окт Ное Дек},
11
+ month_standalone: %w{Януари Февруари Март Април Май Юни Юли Август
12
+ Септември Октомври Ноември Декември},
13
+ date_format: '%d.%m.%Y',
16
14
 
17
- :number_decimal => ",",
18
- :number_group => " "
15
+ number_decimal: ",",
16
+ number_group: " "
19
17
  end
20
18
  end
data/locales/ca.rb CHANGED
@@ -1,22 +1,21 @@
1
- # encoding: utf-8
2
1
  module R18n
3
2
  class Locales::Ca < Locale
4
- set :title => 'Català',
5
- :sublocales => %w{es en},
3
+ set title: 'Català',
4
+ sublocales: %w{es en},
6
5
 
7
- :wday_names => %w{diumenge dilluns dimarts dimecres dijous divendres
8
- dissabte},
9
- :wday_abbrs => %w{dg dl dm dc dj dv ds},
6
+ wday_names: %w{diumenge dilluns dimarts dimecres dijous divendres
7
+ dissabte},
8
+ wday_abbrs: %w{dg dl dm dc dj dv ds},
10
9
 
11
- :month_names => %w{Gener Febrer Març Abril Maig Juny Juliol Agost
12
- Setembre Octubre Novembre Desembre},
13
- :month_abbrs => %w{gen feb mar abr mai jun jul ago set oct nov des},
10
+ month_names: %w{Gener Febrer Març Abril Maig Juny Juliol Agost
11
+ Setembre Octubre Novembre Desembre},
12
+ month_abbrs: %w{gen feb mar abr mai jun jul ago set oct nov des},
14
13
 
15
- :date_format => '%d/%m/%Y',
16
- :full_format => '%d de %B',
17
- :year_format => '_ de %Y',
14
+ date_format: '%d/%m/%Y',
15
+ full_format: '%d de %B',
16
+ year_format: '_ de %Y',
18
17
 
19
- :number_decimal => ",",
20
- :number_group => "."
18
+ number_decimal: ",",
19
+ number_group: "."
21
20
  end
22
21
  end
data/locales/cs.rb CHANGED
@@ -1,25 +1,24 @@
1
- # encoding: utf-8
2
1
  module R18n
3
2
  class Locales::Cs < Locale
4
- set :title => 'Český',
5
- :sublocales => %w{cz sk en},
3
+ set title: 'Český',
4
+ sublocales: %w{cz sk en},
6
5
 
7
- :wday_names => %w{Neděle Pondělí Úterý Středa Čtvrtek Pátek Sobota},
8
- :wday_abbrs => %w{Ne Po Út St Čt Pá So},
6
+ wday_names: %w{Neděle Pondělí Úterý Středa Čtvrtek Pátek Sobota},
7
+ wday_abbrs: %w{Ne Po Út St Čt Pá So},
9
8
 
10
- :month_names => %w{ledna února března dubna května června července srpna
11
- září října listopadu prosince},
12
- :month_abbrs => %w{led úno bře dub kvě čer čvc srp zář říj lis pro},
13
- :month_standalone => %w{Leden Únor Březen Duben Květen Červen Červenec
14
- Srpen Září Říjen Listopad Prosinec},
9
+ month_names: %w{ledna února března dubna května června července srpna
10
+ září října listopadu prosince},
11
+ month_abbrs: %w{led úno bře dub kvě čer čvc srp zář říj lis pro},
12
+ month_standalone: %w{Leden Únor Březen Duben Květen Červen Červenec
13
+ Srpen Září Říjen Listopad Prosinec},
15
14
 
16
- :time_am => 'dop.',
17
- :time_pm => 'odp.',
18
- :date_format => '%e. %m. %Y',
19
- :full_format => '%e. %B',
15
+ time_am: 'dop.',
16
+ time_pm: 'odp.',
17
+ date_format: '%e. %m. %Y',
18
+ full_format: '%e. %B',
20
19
 
21
- :number_decimal => ",",
22
- :number_group => " "
20
+ number_decimal: ",",
21
+ number_group: " "
23
22
 
24
23
  def pluralize(n)
25
24
  case n
data/locales/da.rb CHANGED
@@ -1,23 +1,21 @@
1
- # encoding: utf-8
2
1
  module R18n
3
2
  class Locales::Da < Locale
4
- set :title => 'Dansk',
3
+ set title: 'Dansk',
5
4
 
6
- :wday_names => %w{søndag mandag tirsdag onsdag torsdag fredag
7
- lørdag},
8
- :wday_abbrs => %w{søn man tir ons tor fre lør},
5
+ wday_names: %w{søndag mandag tirsdag onsdag torsdag fredag lørdag},
6
+ wday_abbrs: %w{søn man tir ons tor fre lør},
9
7
 
10
- :month_names => %w{januar februar marts april Maj juni juli august
11
- september oktober november december},
12
- :month_abbrs => %w{jan. feb. mar. apr. maj jun. jul. aug. sep. okt.
13
- nov. dec.},
8
+ month_names: %w{januar februar marts april Maj juni juli august
9
+ september oktober november december},
10
+ month_abbrs: %w{jan. feb. mar. apr. maj jun. jul. aug. sep. okt.
11
+ nov. dec.},
14
12
 
15
- :time_am => 'om formiddagen',
16
- :time_pm => 'om eftermiddagen',
17
- :date_format => '%d.%m.%Y',
18
- :full_format => '%d. %B %Y',
13
+ time_am: 'om formiddagen',
14
+ time_pm: 'om eftermiddagen',
15
+ date_format: '%d.%m.%Y',
16
+ full_format: '%d. %B %Y',
19
17
 
20
- :number_decimal => ",",
21
- :number_group => "."
18
+ number_decimal: ",",
19
+ number_group: "."
22
20
  end
23
21
  end
data/locales/de.rb CHANGED
@@ -1,23 +1,22 @@
1
- # encoding: utf-8
2
1
  module R18n
3
2
  class Locales::De < Locale
4
- set :title => 'Deutsch',
3
+ set title: 'Deutsch',
5
4
 
6
- :wday_names => %w{Sonntag Montag Dienstag Mittwoch Donnerstag Freitag
7
- Samstag},
8
- :wday_abbrs => %w{So Mo Di Mi Do Fr Sa},
5
+ wday_names: %w{Sonntag Montag Dienstag Mittwoch Donnerstag Freitag
6
+ Samstag},
7
+ wday_abbrs: %w{So Mo Di Mi Do Fr Sa},
9
8
 
10
- :month_names => %w{Januar Februar März April Mai Juni Juli August
11
- September Oktober November Dezember},
12
- :month_abbrs => %w{Jan. Feb. Mär. Apr. Mai. Jun. Jul. Aug. Sep. Okt.
13
- Nov. Dez.},
9
+ month_names: %w{Januar Februar März April Mai Juni Juli August
10
+ September Oktober November Dezember},
11
+ month_abbrs: %w{Jan. Feb. Mär. Apr. Mai. Jun. Jul. Aug. Sep. Okt.
12
+ Nov. Dez.},
14
13
 
15
- :time_am => 'vormittags',
16
- :time_pm => 'nachmittags',
17
- :date_format => '%d.%m.%Y',
18
- :full_format => '%e. %B',
14
+ time_am: 'vormittags',
15
+ time_pm: 'nachmittags',
16
+ date_format: '%d.%m.%Y',
17
+ full_format: '%e. %B',
19
18
 
20
- :number_decimal => ",",
21
- :number_group => "."
19
+ number_decimal: ",",
20
+ number_group: "."
22
21
  end
23
22
  end
data/locales/en-au.rb CHANGED
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), 'en')
2
2
 
3
3
  module R18n::Locales
4
4
  class EnAu < En
5
- set :title => 'Australian English',
6
- :sublocales => %w{en}
5
+ set title: 'Australian English',
6
+ sublocales: %w{en}
7
7
  end
8
8
  end
data/locales/en-gb.rb CHANGED
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), 'en')
2
2
 
3
3
  module R18n::Locales
4
4
  class EnGb < En
5
- set :title => 'British English',
6
- :sublocales => %w{en}
5
+ set title: 'British English',
6
+ sublocales: %w{en}
7
7
  end
8
8
  end
data/locales/en-us.rb CHANGED
@@ -1,14 +1,12 @@
1
- # encoding: utf-8
2
-
3
1
  require File.join(File.dirname(__FILE__), 'en')
4
2
 
5
3
  module R18n::Locales
6
4
  class EnUs < En
7
- set :title => 'American English',
8
- :sublocales => %w{en},
5
+ set title: 'American English',
6
+ sublocales: %w{en},
9
7
 
10
- :time_format => ' %I:%M %p',
11
- :date_format => '%m/%d/%Y',
12
- :full_format => '%B %e'
8
+ time_format: ' %I:%M %p',
9
+ date_format: '%m/%d/%Y',
10
+ full_format: '%B %e'
13
11
  end
14
12
  end
data/locales/en.rb CHANGED
@@ -1,23 +1,23 @@
1
1
  module R18n
2
2
  class Locales::En < Locale
3
- set :title => 'English',
4
- :sublocales => [],
3
+ set title: 'English',
4
+ sublocales: [],
5
5
 
6
- :week_start => :sunday,
7
- :wday_names => %w{Sunday Monday Tuesday Wednesday Thursday Friday
8
- Saturday},
9
- :wday_abbrs => %w{Sun Mon Tue Wed Thu Fri Sat},
6
+ week_start: :sunday,
7
+ wday_names: %w{Sunday Monday Tuesday Wednesday Thursday Friday
8
+ Saturday},
9
+ wday_abbrs: %w{Sun Mon Tue Wed Thu Fri Sat},
10
10
 
11
- :month_names => %w{January February March April May June July August
12
- September October November December},
13
- :month_abbrs => %w{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec},
11
+ month_names: %w{January February March April May June July August
12
+ September October November December},
13
+ month_abbrs: %w{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec},
14
14
 
15
- :date_format => '%d/%m/%Y',
16
- :full_format => '%e of %B',
17
- :year_format => '_, %Y',
15
+ date_format: '%d/%m/%Y',
16
+ full_format: '%e of %B',
17
+ year_format: '_, %Y',
18
18
 
19
- :number_decimal => ".",
20
- :number_group => ","
19
+ number_decimal: ".",
20
+ number_group: ","
21
21
 
22
22
  def ordinalize(n)
23
23
  if (11..13).include?(n % 100)