haml-magic-translations 4.1.1 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c90150ee945578913de2ee0a424e4b346816a8d
4
- data.tar.gz: 07dacec7966839bc3630c3f4ac1d91a8b5d9c3e7
3
+ metadata.gz: 6bb2df3164068f7714c6d95997b8ad870286a027
4
+ data.tar.gz: 010ddb5445565f68f13e1cedc0963bb6058c3282
5
5
  SHA512:
6
- metadata.gz: e162b1075cff70133d401ec36b384d68db50ac4d38ea8356e5226e65de4ec2427944e8020f8b710b683d2f9056d47f3ada17588d524da6fb1df77bea78563a5a
7
- data.tar.gz: 797a0943bfa85233e37b62c20119f90d93259f2ae9baf6f5c2a34d66ce05b9f5fc5ab30e589b52837e840af187343e83474bd75b14a961cbf87cb8c881d28b2e
6
+ metadata.gz: 80f6d6b119abb7c06d88336b4830da9cb89a4fa417bb64b9a588bd26bfd168dbc4a9df7901512c6629cabd9cfce2a285c446a4ccc89d24a68bb3f77bd7240174
7
+ data.tar.gz: a909ee753f916f9db985c6ab61b1e2dad7efb2e5099bf7e0761e5dd876d1c1686ce29607af2b28ef9fcfb989a811209eda19ba0d03b879078c190cb947f4224f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.1
1
+ 4.2.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{haml-magic-translations}
8
- s.version = "4.1.1"
8
+ s.version = "4.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kriss Kowalik", "potager.org"]
12
- s.date = %q{2015-09-09}
12
+ s.date = %q{2016-12-19}
13
13
  s.description = %q{This plugin provides "magical translations" in your .haml files. What does it
14
14
  mean? It's mean that all your raw texts in templates will be automatically
15
15
  translated by GetText, FastGettext or Gettext backend from I18n. No more
@@ -105,6 +105,11 @@ module Haml::MagicTranslations::XGetText # :nodoc:
105
105
  end
106
106
 
107
107
  def compile_silent_script
108
+ # Search for explicitely translated strings
109
+ @node.value[:text].gsub(/_\('(([^']|\\')+)'\)/) do |m|
110
+ parsed_string = "#{$1}"
111
+ HamlEngineCompiler.add_target(parsed_string, @node.line)
112
+ end
108
113
  yield if block_given?
109
114
  end
110
115
 
@@ -130,6 +130,16 @@ module Haml::MagicTranslations::XGetText
130
130
  should == [['Hello!', '(haml):1']]
131
131
  end
132
132
  end
133
+ context 'for an explicit translation in an evaluated block' do
134
+ let(:template) do <<-HAML.strip_heredoc
135
+ - [_('Hello!')].each do |v|
136
+ %p= v
137
+ HAML
138
+ end
139
+ it 'should appear as a target' do
140
+ should == [["Hello!", "(haml):1"]]
141
+ end
142
+ end
133
143
  context 'for an explicit translation in an attribute' do
134
144
  let(:template) { "%input(type=submit){ value => _('Upload') }" }
135
145
  it 'should appear as a target' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-magic-translations
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kriss Kowalik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-09 00:00:00.000000000 Z
12
+ date: 2016-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml
@@ -175,3 +175,4 @@ signing_key:
175
175
  specification_version: 3
176
176
  summary: Provides automaticaly translations in haml templates
177
177
  test_files: []
178
+ has_rdoc: