herbgobbler 0.3.7 → 0.3.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/grammer/erb_grammer.treetop
CHANGED
@@ -48,7 +48,7 @@ class GobbleAll
|
|
48
48
|
rails_view_directory = "#{@rails_root}/app/views"
|
49
49
|
full_yml_file_path = "#{@rails_root}/config/locales/#{locale_file_name}"
|
50
50
|
|
51
|
-
rails_translation_store = RailsTranslationStore.
|
51
|
+
rails_translation_store = RailsTranslationStore.load_from_file( full_yml_file_path )
|
52
52
|
text_extractor = RailsTextExtractor.new( rails_translation_store )
|
53
53
|
|
54
54
|
Dir["#{rails_view_directory}/**/*html.erb" ].each do |full_erb_file_path|
|
data/lib/core/i18n_key.rb
CHANGED
@@ -19,6 +19,7 @@ class I18nKey
|
|
19
19
|
to_return = to_return.gsub( / /, '_' )
|
20
20
|
to_return = cut_down_to_size( to_return )
|
21
21
|
to_return = ensure_no_duplicates( to_return )
|
22
|
+
to_return = "#{to_return}_html" if @text =~ /<[\/]?[a-zA-Z]+[^<]*>/
|
22
23
|
self.key_value = to_return
|
23
24
|
end
|
24
25
|
@key_value
|
@@ -27,9 +27,10 @@ class RailsTranslationStore < BaseTranslationStore
|
|
27
27
|
to_return
|
28
28
|
end
|
29
29
|
|
30
|
-
def self.process_yaml_pair( translation_store, key, value,
|
30
|
+
def self.process_yaml_pair( translation_store, key, value, base_directory_like_key )
|
31
31
|
if( value.is_a?( Hash ) )
|
32
32
|
value.each_pair do |key, value|
|
33
|
+
directory_like_key = base_directory_like_key
|
33
34
|
if( value.is_a?( Hash ) )
|
34
35
|
directory_like_key = "#{directory_like_key}/" unless directory_like_key.empty?
|
35
36
|
directory_like_key = "#{directory_like_key}#{key}"
|
@@ -38,7 +39,7 @@ class RailsTranslationStore < BaseTranslationStore
|
|
38
39
|
end
|
39
40
|
translation_store
|
40
41
|
else
|
41
|
-
translation_store.start_new_context(
|
42
|
+
translation_store.start_new_context( base_directory_like_key )
|
42
43
|
translation_store.add_translation( key, value )
|
43
44
|
translation_store
|
44
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: herbgobbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|