whowish_word 0.6.2 → 0.6.3

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/idea.md ADDED
@@ -0,0 +1,6 @@
1
+ Ideas
2
+ ===================
3
+
4
+ * Inverse of whowish_word: an admin can highlight a literal text on a website and put an i18n translate function there
5
+ * Make it for consumers: supporting multiple browsers and improving performance
6
+ * When making a change on the live site, we commit the new config file to Github
@@ -11,16 +11,16 @@ module WhowishWord
11
11
  # include WhowishWord::Authentication
12
12
 
13
13
  attr_accessor :config_file_dir
14
-
14
+
15
15
  def init(config_file_dir = File.join(Rails.root, 'config', 'locales', 'whowish_word'))
16
16
  install_route
17
17
  install_hook
18
18
  load_rails
19
19
 
20
20
  @config_file_dir = config_file_dir
21
-
21
+
22
22
  Rails.configuration.i18n.load_path = Dir[File.join(@config_file_dir, '**', '*.{rb,yml}')]
23
-
23
+
24
24
  I18n.class_eval do
25
25
  class << self
26
26
  def translations
@@ -32,7 +32,7 @@ module WhowishWord
32
32
  I18n::MissingTranslation::Base.class_eval do
33
33
  def html_message
34
34
  key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1 }
35
- key
35
+ I18n.interpolate_hash(key, options)
36
36
  end
37
37
  end
38
38
 
@@ -43,7 +43,7 @@
43
43
  <b>Image: </b> <img src="<%=ta :image_src%>">
44
44
  </span>
45
45
  <span>
46
- <b>Text: </b> <%=t :text, :name => "Tanin"%>
46
+ <b>Text: </b> <%=t '.default_variable_%{name}', :name => "Tanin"%>
47
47
  </span>
48
48
  <span>
49
49
  <b>Bullet: </b> <ul>
@@ -60,8 +60,8 @@
60
60
  </span>
61
61
  <span>
62
62
  <b>Textbox: </b> <input type="textbox" name="<%=Time.now.to_i%>_0"
63
- title="<%=ta :textbox_title%>"
64
- value="<%=ta :textbox_value%>"
63
+ title="<%=ta :textbox_title%>"
64
+ value="<%=ta :textbox_value%>"
65
65
  placeholder="<%=ta :textbox_placeholder%>">
66
66
  </span>
67
67
  <span>
@@ -71,12 +71,12 @@
71
71
  </span>
72
72
  <span>
73
73
  <b>Checkbox: </b> <input type="checkbox" name="<%=Time.now.to_i%>_2"
74
- title="<%=ta :checkbox_title%>"
74
+ title="<%=ta :checkbox_title%>"
75
75
  value="<%=ta :checkbox_value%>">
76
76
  </span>
77
77
  <span>
78
78
  <b>Radio: </b> <input type="radio" name="<%=Time.now.to_i%>_3"
79
- title="<%=ta :radio_title%>"
79
+ title="<%=ta :radio_title%>"
80
80
  value="<%=ta :radio_value%>">
81
81
  </span>
82
82
  <span>
@@ -86,15 +86,15 @@
86
86
  </select>
87
87
  </span>
88
88
  <span>
89
- <b>Button(Input): </b> <input type="button"
90
- title="<%=ta :input_button_title%>"
91
- value="<%=ta :input_button_value%>"
89
+ <b>Button(Input): </b> <input type="button"
90
+ title="<%=ta :input_button_title%>"
91
+ value="<%=ta :input_button_value%>"
92
92
  onclick="alert('hello');">
93
93
  </span>
94
94
  <span>
95
- <b>Submit(Input): </b> <input type="submit"
96
- title="<%=ta :submit_title%>"
97
- value="<%=ta :submit_value%>"
95
+ <b>Submit(Input): </b> <input type="submit"
96
+ title="<%=ta :submit_title%>"
97
+ value="<%=ta :submit_value%>"
98
98
  onclick="alert('hello');">
99
99
  </span>
100
100
  <span>
@@ -102,29 +102,29 @@
102
102
  </span>
103
103
  <span>
104
104
  <b>Late Text: </b> <span id="late_text"></span>
105
-
105
+
106
106
  <script type="text/javascript">
107
-
107
+
108
108
  setTimeout(function() {
109
109
  $('#late_text').html("<%=t :late_text%>");
110
110
  },5000);
111
-
111
+
112
112
  </script>
113
113
  </span>
114
114
  <span>
115
115
  <b>Late Textbox: </b> <input type="textbox" id="late_textbox" name="<%=rand(1000)%>"
116
- title="title"
117
- value="value"
116
+ title="title"
117
+ value="value"
118
118
  placeholder="placeholder">
119
-
119
+
120
120
  <script type="text/javascript">
121
-
121
+
122
122
  setTimeout(function() {
123
123
  $('#late_textbox').attr("title","<%=ta :late_textbox_title%>");
124
124
  $('#late_textbox').val("<%=ta :late_textbox_value%>");
125
125
  $('#late_textbox').attr("placeholder","<%=ta :late_textbox_placeholder%>");
126
126
  },5000);
127
-
127
+
128
128
  </script>
129
129
  </span>
130
130
  </div>
data/whowish_word.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "whowish_word"
6
- s.version = "0.6.2"
6
+ s.version = "0.6.3"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Tanin Na Nakorn"]
9
9
  s.email = ["tanin47@yahoo.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whowish_word
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
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-07-24 00:00:00.000000000 Z
12
+ date: 2012-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubyzip
@@ -40,6 +40,7 @@ files:
40
40
  - Gemfile
41
41
  - HOW_TO_BUILD_WHOWISH_HOOK.md
42
42
  - README.md
43
+ - idea.md
43
44
  - lib/whowish_word.rb
44
45
  - lib/whowish_word/action_controller/base.rb
45
46
  - lib/whowish_word/action_mailer/base.rb
@@ -178,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
179
  version: '0'
179
180
  requirements: []
180
181
  rubyforge_project: whowish_word
181
- rubygems_version: 1.8.21
182
+ rubygems_version: 1.8.24
182
183
  signing_key:
183
184
  specification_version: 3
184
185
  summary: whowish_word