gettext_i18n_rails 0.2.3 → 0.2.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gettext_i18n_rails}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2010-08-25}
12
+ s.date = %q{2010-09-25}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.files = [
15
15
  ".gitignore",
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
23
23
  "lib/gettext_i18n_rails/active_record.rb",
24
24
  "lib/gettext_i18n_rails/backend.rb",
25
25
  "lib/gettext_i18n_rails/haml_parser.rb",
26
+ "lib/gettext_i18n_rails/html_safe_translations.rb",
26
27
  "lib/gettext_i18n_rails/i18n_hacks.rb",
27
28
  "lib/gettext_i18n_rails/model_attributes_finder.rb",
28
29
  "lib/gettext_i18n_rails/ruby_gettext_extractor.rb",
@@ -12,6 +12,12 @@ end
12
12
  # include translations into all the places it needs to go...
13
13
  Object.send(:include, FastGettext::Translation)
14
14
 
15
+ # make translations html_safe if needed
16
+ if "".respond_to?(:html_safe?)
17
+ require 'gettext_i18n_rails/html_safe_translations'
18
+ Object.send(:include, GettextI18nRails::HtmlSafeTranslations)
19
+ end
20
+
15
21
  require 'gettext_i18n_rails/backend'
16
22
  I18n.backend = GettextI18nRails::Backend.new
17
23
 
@@ -0,0 +1,19 @@
1
+ module GettextI18nRails
2
+ module HtmlSafeTranslations
3
+ def self.included(base)
4
+ base.extend self
5
+ end
6
+
7
+ def _(*args)
8
+ super(*args).to_s.html_safe
9
+ end
10
+
11
+ def n_(*args)
12
+ super(*args).to_s.html_safe
13
+ end
14
+
15
+ def s_(*args)
16
+ super(*args).to_s.html_safe
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 3
9
- version: 0.2.3
8
+ - 4
9
+ version: 0.2.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Grosser
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-25 00:00:00 +02:00
17
+ date: 2010-09-25 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -49,6 +49,7 @@ files:
49
49
  - lib/gettext_i18n_rails/active_record.rb
50
50
  - lib/gettext_i18n_rails/backend.rb
51
51
  - lib/gettext_i18n_rails/haml_parser.rb
52
+ - lib/gettext_i18n_rails/html_safe_translations.rb
52
53
  - lib/gettext_i18n_rails/i18n_hacks.rb
53
54
  - lib/gettext_i18n_rails/model_attributes_finder.rb
54
55
  - lib/gettext_i18n_rails/ruby_gettext_extractor.rb