flash_helper 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -31,6 +31,12 @@ Then in your controllers you can use :
31
31
  flash[:errors] = "Creation failed!"
32
32
  flash[:errors] = @news.errors
33
33
  flash[:warning] = "The new user has no blog associated..."
34
+
35
+ If you're using Rails >= 2.2, you can translate plugin internal messages.
36
+ For example in config/locales/fr.yml you can add :
37
+
38
+ flash_helper:
39
+ default_message: "Il y a des problèmes dans le formulaire :"
34
40
 
35
41
  Tune display_flashes :
36
42
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rubyforge'
6
6
 
7
7
  SPEC = Gem::Specification.new do |s|
8
8
  s.name = 'flash_helper'
9
- s.version = '1.0.3'
9
+ s.version = '1.0.4'
10
10
  s.authors = ['Nicolas Cavigneaux']
11
11
  s.email = 'nico@bounga.org'
12
12
  s.homepage = 'http://www.bitbucket.org/Bounga/flash-helper'
@@ -14,8 +14,8 @@ border: solid 1px #ffc707;
14
14
  background-color: #FCC;
15
15
  border: solid 1px #C66;
16
16
  }
17
- .fieldWithErrors {
18
- display: inline;
17
+ .fieldWithErrors label{
18
+ border: 2px solid #C66;
19
19
  }
20
20
  #errorExplanation {
21
21
  width: 400px;
@@ -16,6 +16,12 @@ module Bounga
16
16
  # flash[:errors] = "Creation failed!"
17
17
  # flash[:errors] = @news.errors
18
18
  # flash[:warning] = "The new user has no blog associated..."
19
+ #
20
+ # If you're using Rails >= 2.2, you can translate plugin internal messages.
21
+ # For example in config/locales/fr.yml you can add :
22
+ #
23
+ # flash_helper:
24
+ # default_message: "Il y a des problèmes dans le formulaire :"
19
25
 
20
26
  # == Global options for helpers
21
27
  #
@@ -38,6 +44,17 @@ module Bounga
38
44
  }
39
45
  mattr_reader :flash_options
40
46
 
47
+ # Enable I18n if using Rails >= 2.2
48
+ if Rails::VERSION::STRING >= '2.2'
49
+ I18n.backend.store_translations :'en', {
50
+ :flash_helper => {
51
+ :default_message => 'There are problems in your submission:'
52
+ }
53
+ }
54
+ @@flash_options.merge!(:default_message => I18n.t('flash_helper.default_message'))
55
+ end
56
+
57
+
41
58
  # Display flash messages.
42
59
  # You can pass an optional string as a parameter. It will be display before
43
60
  # error messages.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Cavigneaux