r18n-core 0.4.7.1 → 0.4.8
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.
- data/ChangeLog +7 -0
- data/README.rdoc +4 -2
- data/base/da.yml +31 -0
- data/lib/r18n-core/filters.rb +6 -0
- data/lib/r18n-core/i18n.rb +1 -1
- data/lib/r18n-core/version.rb +1 -1
- data/locales/da.rb +23 -0
- data/locales/it.rb +2 -1
- data/spec/filters_spec.rb +8 -1
- data/spec/i18n_spec.rb +1 -1
- data/spec/locale_spec.rb +1 -1
- data/spec/locales/cs_spec.rb +1 -1
- data/spec/locales/en-us_spec.rb +1 -1
- data/spec/locales/en_spec.rb +1 -1
- data/spec/locales/fr_spec.rb +1 -1
- data/spec/locales/hu_spec.rb +1 -1
- data/spec/locales/it_spec.rb +1 -1
- data/spec/locales/pl_spec.rb +1 -1
- data/spec/locales/ru_spec.rb +1 -1
- data/spec/locales/sk_spec.rb +1 -1
- data/spec/locales/th_spec.rb +1 -1
- data/spec/r18n_spec.rb +1 -1
- data/spec/translated_spec.rb +2 -2
- data/spec/translation_spec.rb +1 -1
- data/spec/yaml_loader_spec.rb +1 -1
- metadata +6 -5
data/ChangeLog
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.4.8 (En ni to)
|
2
|
+
* Fix support for Ruby 1.9.2.
|
3
|
+
* Fix caching issue (by Viktors Rotanovs).
|
4
|
+
* Add Danish locale (by Hans Czajkowski Jørgensen)
|
5
|
+
* Fix Italian locale (by Viktors Rotanovs).
|
6
|
+
* Move untranslated filters with html highlight to r18n-core.
|
7
|
+
|
1
8
|
== 0.4.7.1 (Kyū)
|
2
9
|
* Fix Japanese locale in Ruby 1.9.1.
|
3
10
|
|
data/README.rdoc
CHANGED
@@ -94,7 +94,8 @@ plugins).
|
|
94
94
|
|
95
95
|
=== Object Translation
|
96
96
|
|
97
|
-
You can translate any class, including ORM models
|
97
|
+
You can translate any class, including ORM models (ActiveRecord, DataMapper,
|
98
|
+
MongoMapper, Mongoid or others):
|
98
99
|
|
99
100
|
require 'r18n-core/translated'
|
100
101
|
|
@@ -360,7 +361,8 @@ and <tt>:standard</tt> (the default):
|
|
360
361
|
|
361
362
|
=== Model
|
362
363
|
|
363
|
-
You can add i18n support to any classes, including ORM models
|
364
|
+
You can add i18n support to any classes, including ORM models (ActiveRecord,
|
365
|
+
DataMapper, MongoMapper, Mongoid or others):
|
364
366
|
|
365
367
|
require 'r18n-core/translated'
|
366
368
|
|
data/base/da.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
ok: OK
|
2
|
+
save: Gem
|
3
|
+
cancel: Annullér
|
4
|
+
'yes': 'Ja'
|
5
|
+
'no': 'Nej'
|
6
|
+
exit: Afslut
|
7
|
+
delete: Slet
|
8
|
+
|
9
|
+
human_time:
|
10
|
+
after_days: !!pl
|
11
|
+
1: efter %1 dag
|
12
|
+
n: efter %1 dage
|
13
|
+
tomorrow: i morgen
|
14
|
+
after_hours: !!pl
|
15
|
+
1: efter %1 time
|
16
|
+
n: efter %1 timer
|
17
|
+
after_minutes: !!pl
|
18
|
+
1: efter %1 minut
|
19
|
+
n: efter %1 minutter
|
20
|
+
now: nu
|
21
|
+
today: i dag
|
22
|
+
minutes_ago: !!pl
|
23
|
+
1: %1 minut siden
|
24
|
+
n: %1 minutter siden
|
25
|
+
hours_ago: !!pl
|
26
|
+
1: %1 time siden
|
27
|
+
n: %1 timer siden
|
28
|
+
yesterday: i går
|
29
|
+
days_ago: !!pl
|
30
|
+
1: %1 dag siden
|
31
|
+
n: %1 dage siden
|
data/lib/r18n-core/filters.rb
CHANGED
@@ -247,6 +247,12 @@ module R18n
|
|
247
247
|
"#{translated}[#{untranslated}]"
|
248
248
|
end
|
249
249
|
|
250
|
+
Filters.add(Untranslated, :untranslated_html) do |v, c, transl, untransl|
|
251
|
+
Utils.escape_html(transl) <<
|
252
|
+
'<span style="color: red">' << Utils.escape_html(untransl) << '</span>'
|
253
|
+
end
|
254
|
+
Filters.off(:untranslated_html)
|
255
|
+
|
250
256
|
Filters.add('escape', :escape_html, :passive => true) do |content, config|
|
251
257
|
config[:dont_escape_html] = true
|
252
258
|
Utils.escape_html(content)
|
data/lib/r18n-core/i18n.rb
CHANGED
@@ -183,7 +183,7 @@ module R18n
|
|
183
183
|
# Return unique key for current locales in translation and places.
|
184
184
|
def translation_cache_key
|
185
185
|
@available_codes ||= @translation_places.inject([]) { |all, i|
|
186
|
-
all + i.available }.uniq.map { |i| i.code }
|
186
|
+
all + i.available }.uniq.map { |i| i.code.downcase }
|
187
187
|
(@locales_codes & @available_codes).join(',') + '@' +
|
188
188
|
R18n.default_loader.hash.to_s +
|
189
189
|
@translation_places.hash.to_s + R18n.extension_places.hash.to_s
|
data/lib/r18n-core/version.rb
CHANGED
data/locales/da.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module R18n
|
3
|
+
class Locales::Da < Locale
|
4
|
+
set :title => 'Dansk',
|
5
|
+
|
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},
|
9
|
+
|
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.},
|
14
|
+
|
15
|
+
:time_am => 'om formiddagen',
|
16
|
+
:time_pm => 'om eftermiddagen',
|
17
|
+
:date_format => '%d.%m.%Y',
|
18
|
+
:full_format => '%d. %B %Y',
|
19
|
+
|
20
|
+
:number_decimal => ",",
|
21
|
+
:number_group => "."
|
22
|
+
end
|
23
|
+
end
|
data/locales/it.rb
CHANGED
@@ -7,7 +7,8 @@ module R18n
|
|
7
7
|
sabato},
|
8
8
|
:wday_abbrs => %w{dom lun mar mer gio ven sab},
|
9
9
|
|
10
|
-
:month_names => %w{gennaio febbraio marzo aprile maggio giugno
|
10
|
+
:month_names => %w{gennaio febbraio marzo aprile maggio giugno
|
11
|
+
luglio agosto settembre ottobre novembre dicembre},
|
11
12
|
:month_abbrs => %w{gen feb mar apr mag giu lug ago set ott nov dic},
|
12
13
|
|
13
14
|
:date_format => '%d/%m/%Y',
|
data/spec/filters_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.
|
2
|
+
require File.expand_path('../spec_helper', __FILE__)
|
3
3
|
|
4
4
|
describe R18n::Filters do
|
5
5
|
before do
|
@@ -188,6 +188,13 @@ describe R18n::Filters do
|
|
188
188
|
@i18n.in.another.to_s.should == 'in.another in.another[]'
|
189
189
|
end
|
190
190
|
|
191
|
+
it "should format untranslated for web" do
|
192
|
+
R18n::Filters.off(:untranslated)
|
193
|
+
R18n::Filters.on(:untranslated_html)
|
194
|
+
@i18n.in.not.to_s.should == 'in.<span style="color: red">not</span>'
|
195
|
+
@i18n['<b>'].to_s.should == '<span style="color: red"><b></span>'
|
196
|
+
end
|
197
|
+
|
191
198
|
it "should have filter for escape HTML" do
|
192
199
|
@i18n.html.should == '<script>true && false</script>'
|
193
200
|
end
|
data/spec/i18n_spec.rb
CHANGED
data/spec/locale_spec.rb
CHANGED
data/spec/locales/cs_spec.rb
CHANGED
data/spec/locales/en-us_spec.rb
CHANGED
data/spec/locales/en_spec.rb
CHANGED
data/spec/locales/fr_spec.rb
CHANGED
data/spec/locales/hu_spec.rb
CHANGED
data/spec/locales/it_spec.rb
CHANGED
data/spec/locales/pl_spec.rb
CHANGED
data/spec/locales/ru_spec.rb
CHANGED
data/spec/locales/sk_spec.rb
CHANGED
data/spec/locales/th_spec.rb
CHANGED
data/spec/r18n_spec.rb
CHANGED
data/spec/translated_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require File.
|
3
|
-
require File.
|
2
|
+
require File.expand_path('../spec_helper', __FILE__)
|
3
|
+
require File.expand_path('../../lib/r18n-core/translated', __FILE__)
|
4
4
|
|
5
5
|
describe R18n::Translated do
|
6
6
|
before do
|
data/spec/translation_spec.rb
CHANGED
data/spec/yaml_loader_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r18n-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 0.4.7.1
|
9
|
+
- 8
|
10
|
+
version: 0.4.8
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Andrey "A.I." Sitnik
|
@@ -16,7 +15,7 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2010-
|
18
|
+
date: 2010-09-22 00:00:00 +04:00
|
20
19
|
default_executable:
|
21
20
|
dependencies: []
|
22
21
|
|
@@ -39,6 +38,7 @@ files:
|
|
39
38
|
- base/sk.yml
|
40
39
|
- base/kk.yml
|
41
40
|
- base/es.yml
|
41
|
+
- base/da.yml
|
42
42
|
- base/fi.yml
|
43
43
|
- base/lv.yml
|
44
44
|
- base/de.yml
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- locales/ru.rb
|
80
80
|
- locales/en-us.rb
|
81
81
|
- locales/ja.rb
|
82
|
+
- locales/da.rb
|
82
83
|
- locales/en-gb.rb
|
83
84
|
- locales/de.rb
|
84
85
|
- locales/hu.rb
|