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.
- checksums.yaml +4 -4
- data/ChangeLog.md +4 -0
- data/README.md +2 -2
- data/lib/r18n-core/filter_list.rb +2 -3
- data/lib/r18n-core/filters.rb +9 -10
- data/lib/r18n-core/helpers.rb +0 -1
- data/lib/r18n-core/i18n.rb +1 -2
- data/lib/r18n-core/locale.rb +10 -12
- data/lib/r18n-core/translated.rb +3 -4
- data/lib/r18n-core/translated_string.rb +0 -1
- data/lib/r18n-core/translation.rb +2 -3
- data/lib/r18n-core/unsupported_locale.rb +0 -1
- data/lib/r18n-core/untranslated.rb +0 -1
- data/lib/r18n-core/utils.rb +0 -11
- data/lib/r18n-core/version.rb +1 -2
- data/lib/r18n-core/yaml_loader.rb +0 -1
- data/lib/r18n-core/yaml_methods.rb +2 -8
- data/lib/r18n-core.rb +0 -3
- data/locales/bg.rb +11 -13
- data/locales/ca.rb +13 -14
- data/locales/cs.rb +15 -16
- data/locales/da.rb +13 -15
- data/locales/de.rb +14 -15
- data/locales/en-au.rb +2 -2
- data/locales/en-gb.rb +2 -2
- data/locales/en-us.rb +5 -7
- data/locales/en.rb +14 -14
- data/locales/eo.rb +11 -12
- data/locales/es-us.rb +6 -8
- data/locales/es.rb +11 -12
- data/locales/fi.rb +16 -17
- data/locales/fr.rb +10 -11
- data/locales/gl.rb +12 -13
- data/locales/hr.rb +12 -13
- data/locales/hu.rb +12 -13
- data/locales/id.rb +9 -9
- data/locales/it.rb +9 -10
- data/locales/ja.rb +11 -12
- data/locales/kk.rb +16 -18
- data/locales/lv.rb +16 -17
- data/locales/mn.rb +12 -14
- data/locales/nb.rb +12 -13
- data/locales/nl.rb +13 -14
- data/locales/no.rb +12 -13
- data/locales/pl.rb +13 -14
- data/locales/pt-br.rb +2 -3
- data/locales/pt.rb +13 -14
- data/locales/ru.rb +14 -15
- data/locales/sk.rb +15 -16
- data/locales/sr-latn.rb +12 -14
- data/locales/sv-se.rb +11 -13
- data/locales/th.rb +13 -14
- data/locales/tr.rb +12 -15
- data/locales/uk.rb +11 -15
- data/locales/zh-cn.rb +2 -3
- data/locales/zh-tw.rb +5 -6
- data/locales/zh.rb +10 -11
- data/r18n-core.gemspec +5 -4
- data/spec/filters_spec.rb +94 -91
- data/spec/i18n_spec.rb +66 -68
- data/spec/locale_spec.rb +74 -74
- data/spec/locales/cs_spec.rb +14 -14
- data/spec/locales/en-us_spec.rb +6 -6
- data/spec/locales/en_spec.rb +6 -6
- data/spec/locales/fr_spec.rb +2 -2
- data/spec/locales/hu_spec.rb +6 -7
- data/spec/locales/it_spec.rb +3 -4
- data/spec/locales/pl_spec.rb +14 -14
- data/spec/locales/ru_spec.rb +13 -13
- data/spec/locales/sk_spec.rb +14 -14
- data/spec/locales/th_spec.rb +2 -2
- data/spec/r18n_spec.rb +47 -49
- data/spec/spec_helper.rb +0 -7
- data/spec/translated_spec.rb +26 -28
- data/spec/translation_spec.rb +38 -40
- data/spec/yaml_loader_spec.rb +14 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b02d3737730702d611d4ae58c955c6a8ada010ec
|
4
|
+
data.tar.gz: 6cd70b7df39a5d1e88e7931d9987d3b81cae309c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d9c896e1da05e05b004070f78ca2f659216e13b3d4c14e9fb3b6deefab72ed3c950eb3e3d08d7d38dd62edf159c7294047e4d561c21de624734e78f3a710772
|
7
|
+
data.tar.gz: de05088818bf8af4f7919323cb73db54b7b3dc2283b257f961303d972f8ae1bafdbf8fd0395ce86616576d812e83025a23bcea3e8a6a98e997483e76c7e5bbc7
|
data/ChangeLog.md
CHANGED
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
|
-
*
|
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', :
|
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 = { :
|
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 = { :
|
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)
|
data/lib/r18n-core/filters.rb
CHANGED
@@ -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', :
|
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, :
|
80
|
-
# :
|
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
|
-
:
|
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, :
|
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, :
|
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, :
|
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, :
|
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, :
|
298
|
+
Filters.add('textile', :redcloth, passive: true) do |content, config|
|
300
299
|
require 'redcloth'
|
301
300
|
::RedCloth.new(content).to_html
|
302
301
|
end
|
data/lib/r18n-core/helpers.rb
CHANGED
data/lib/r18n-core/i18n.rb
CHANGED
@@ -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, '', :
|
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|
|
data/lib/r18n-core/locale.rb
CHANGED
@@ -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 :
|
96
|
-
# :
|
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 :
|
116
|
-
|
117
|
-
:
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
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(
|
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
|
data/lib/r18n-core/translated.rb
CHANGED
@@ -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, :
|
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, {:
|
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, :
|
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 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
|
-
:
|
92
|
+
locale: locale, translations: value, filters: @filters)
|
94
93
|
when String
|
95
|
-
c = { :
|
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
|
data/lib/r18n-core/utils.rb
CHANGED
@@ -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 = { '&' => '&', '<' => '<', '>' => '>' }
|
35
24
|
|
36
25
|
# Escape HTML entries (<, >, &). Copy from HAML helper.
|
data/lib/r18n-core/version.rb
CHANGED
@@ -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?(
|
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
|
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 :
|
3
|
+
set title: 'Български',
|
5
4
|
|
6
|
-
:
|
7
|
-
|
8
|
-
:wday_abbrs => %w{Нед Пон Вто Сря Чет Пет Съб},
|
5
|
+
wday_names: %w{Неделя Понеделник Вторник Сряда Четвъртък Петък Събота},
|
6
|
+
wday_abbrs: %w{Нед Пон Вто Сря Чет Пет Съб},
|
9
7
|
|
10
|
-
:
|
11
|
-
|
12
|
-
:
|
13
|
-
:
|
14
|
-
|
15
|
-
:
|
8
|
+
month_names: %w{Януари Февруари Март Април Май Юни Юли Август
|
9
|
+
Септември Октомври Ноември Декември},
|
10
|
+
month_abbrs: %w{Яну Фев Мар Апр Май Юни Юли Авг Сеп Окт Ное Дек},
|
11
|
+
month_standalone: %w{Януари Февруари Март Април Май Юни Юли Август
|
12
|
+
Септември Октомври Ноември Декември},
|
13
|
+
date_format: '%d.%m.%Y',
|
16
14
|
|
17
|
-
:
|
18
|
-
:
|
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 :
|
5
|
-
:
|
3
|
+
set title: 'Català',
|
4
|
+
sublocales: %w{es en},
|
6
5
|
|
7
|
-
:
|
8
|
-
|
9
|
-
:
|
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
|
-
:
|
12
|
-
|
13
|
-
:
|
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
|
-
:
|
16
|
-
:
|
17
|
-
:
|
14
|
+
date_format: '%d/%m/%Y',
|
15
|
+
full_format: '%d de %B',
|
16
|
+
year_format: '_ de %Y',
|
18
17
|
|
19
|
-
:
|
20
|
-
:
|
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 :
|
5
|
-
:
|
3
|
+
set title: 'Český',
|
4
|
+
sublocales: %w{cz sk en},
|
6
5
|
|
7
|
-
:
|
8
|
-
:
|
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
|
-
:
|
11
|
-
|
12
|
-
:
|
13
|
-
:
|
14
|
-
|
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
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
15
|
+
time_am: 'dop.',
|
16
|
+
time_pm: 'odp.',
|
17
|
+
date_format: '%e. %m. %Y',
|
18
|
+
full_format: '%e. %B',
|
20
19
|
|
21
|
-
:
|
22
|
-
:
|
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 :
|
3
|
+
set title: 'Dansk',
|
5
4
|
|
6
|
-
:
|
7
|
-
|
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
|
-
:
|
11
|
-
|
12
|
-
:
|
13
|
-
|
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
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
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
|
-
:
|
21
|
-
:
|
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 :
|
3
|
+
set title: 'Deutsch',
|
5
4
|
|
6
|
-
:
|
7
|
-
|
8
|
-
:
|
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
|
-
:
|
11
|
-
|
12
|
-
:
|
13
|
-
|
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
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
14
|
+
time_am: 'vormittags',
|
15
|
+
time_pm: 'nachmittags',
|
16
|
+
date_format: '%d.%m.%Y',
|
17
|
+
full_format: '%e. %B',
|
19
18
|
|
20
|
-
:
|
21
|
-
:
|
19
|
+
number_decimal: ",",
|
20
|
+
number_group: "."
|
22
21
|
end
|
23
22
|
end
|
data/locales/en-au.rb
CHANGED
data/locales/en-gb.rb
CHANGED
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 :
|
8
|
-
:
|
5
|
+
set title: 'American English',
|
6
|
+
sublocales: %w{en},
|
9
7
|
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
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 :
|
4
|
-
:
|
3
|
+
set title: 'English',
|
4
|
+
sublocales: [],
|
5
5
|
|
6
|
-
:
|
7
|
-
:
|
8
|
-
|
9
|
-
:
|
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
|
-
:
|
12
|
-
|
13
|
-
:
|
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
|
-
:
|
16
|
-
:
|
17
|
-
:
|
15
|
+
date_format: '%d/%m/%Y',
|
16
|
+
full_format: '%e of %B',
|
17
|
+
year_format: '_, %Y',
|
18
18
|
|
19
|
-
:
|
20
|
-
:
|
19
|
+
number_decimal: ".",
|
20
|
+
number_group: ","
|
21
21
|
|
22
22
|
def ordinalize(n)
|
23
23
|
if (11..13).include?(n % 100)
|