translations_ennder 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.bnsignore +3 -0
- data/History.txt +4 -1
- data/app/helpers/application_helper.rb +1 -1
- data/bin/.directory +3 -0
- data/lib/translations_ennder/rails.rb +9 -14
- data/version.txt +1 -1
- metadata +7 -6
- data/lib/tasks/translations_ennder_tasks.rake +0 -4
data/.bnsignore
CHANGED
data/History.txt
CHANGED
@@ -54,4 +54,7 @@ RAILS_ROOT au lien de Rails.root, Rails n'est pas encore initalisé
|
|
54
54
|
== 1.1.2 / 2011-03-22
|
55
55
|
* trace changement de locale dans la session
|
56
56
|
format date-heure short: JJ/MM/AASS HHhMM
|
57
|
-
Enfin testé
|
57
|
+
Enfin testé
|
58
|
+
|
59
|
+
== 1.1.3 / 2011-03-29
|
60
|
+
* monkey patching localisations réactivé pour Rails 3
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module ApplicationHelper
|
3
3
|
#Label de la forme : "<b><nom_colonne></b>: "
|
4
4
|
def label_bold_and_colon(object_name, method, text = nil, options = {})
|
5
|
-
Rails.logger.debug "DEBUG JBA : #{self.class.name}.label_bold_and_colon(#{object_name}, #{method}, #{text}, #{options})"
|
5
|
+
# Rails.logger.debug "DEBUG JBA : #{self.class.name}.label_bold_and_colon(#{object_name}, #{method}, #{text}, #{options})"
|
6
6
|
if text.blank?
|
7
7
|
label(true, object_name, method, method.humanize, true, options)
|
8
8
|
else
|
data/bin/.directory
ADDED
@@ -6,14 +6,14 @@ def init_translations_ennder
|
|
6
6
|
I18n.load_path.unshift File.expand_path(File.join(File.dirname(__FILE__), 'locales', 'en.yml'))
|
7
7
|
I18n.load_path.unshift File.expand_path(File.join(File.dirname(__FILE__), 'locales', 'fr.yml'))
|
8
8
|
|
9
|
-
if Rails::VERSION::MAJOR < 3
|
10
|
-
#JBA
|
9
|
+
# if Rails::VERSION::MAJOR < 3
|
10
|
+
#JBA 2011-03-29, sera caduque avec Rails 3 ?
|
11
11
|
#pour que to_s prenne en compte les formats localisés
|
12
12
|
# Date.send :include, ConversionsWithI18nToS
|
13
13
|
# Time.send :include, ConversionsWithI18nToS
|
14
14
|
ActiveSupport::TimeWithZone.send :include, ConversionsWithI18nToS
|
15
15
|
ActionView::Helpers::FormHelper.send :include, ConversionsWithI18nLabel
|
16
|
-
end
|
16
|
+
# end
|
17
17
|
end
|
18
18
|
|
19
19
|
|
@@ -21,8 +21,9 @@ if Rails::VERSION::MAJOR < 3 then
|
|
21
21
|
#Rails 2
|
22
22
|
|
23
23
|
Rails.configuration.after_initialize do
|
24
|
-
_info = "
|
24
|
+
_info = "GEM translations_ennder V#{TranslationsEnnder.version}, translations_ennder/rails.rb, Railx V2.x.y"
|
25
25
|
|
26
|
+
puts "Rails.configuration.after_initialize, RAILS_ROOT=[#{RAILS_ROOT}], RAILS_ENV=#{RAILS_ENV}"
|
26
27
|
if RAILS_DEFAULT_LOGGER.nil?
|
27
28
|
_logger = Logger.new( File.join(RAILS_ROOT, "log", "#{RAILS_ENV}.log") )
|
28
29
|
else
|
@@ -35,14 +36,8 @@ if Rails::VERSION::MAJOR < 3 then
|
|
35
36
|
else
|
36
37
|
#Rails 3
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
if Rails.logger.nil?
|
41
|
-
_logger = Logger.new(::Rails.root.to_s + "log/#{Rails.env}.log")
|
42
|
-
else
|
43
|
-
_logger = Rails.logger
|
44
|
-
end
|
45
|
-
_logger.info _info
|
39
|
+
# Rails n'est pas encore initalisé dans ce cas
|
40
|
+
puts "GEM translations_ennder V#{TranslationsEnnder.version}, translations_ennder/rails.rb, Railx V3.x.y"
|
46
41
|
|
47
42
|
init_translations_ennder
|
48
43
|
end
|
@@ -73,10 +68,10 @@ module ActionController
|
|
73
68
|
set_locale_session_or_fr
|
74
69
|
end
|
75
70
|
|
76
|
-
# logger.debug "locale=[#{session[:locale]}]"
|
71
|
+
# logger.debug "GEM translations_ennder, locale=[#{session[:locale]}]"
|
77
72
|
|
78
73
|
if session[:locale] != I18n.locale
|
79
|
-
logger.debug "
|
74
|
+
logger.debug "GEM translations_ennder, set_locale [#{session[:locale]}]=>[#{I18n.locale}]"
|
80
75
|
session[:locale] = I18n.locale
|
81
76
|
end
|
82
77
|
end
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.3
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: translations_ennder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 3
|
10
|
+
version: 1.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ennder
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-29 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -38,14 +38,15 @@ description: "Ce plugin apporte des traductions standard en fran\xC3\xA7ais et a
|
|
38
38
|
This plugin brings translations in french and english."
|
39
39
|
email: mel@ennder.fr
|
40
40
|
executables:
|
41
|
+
- .directory
|
41
42
|
- translations_ennder
|
42
43
|
extensions: []
|
43
44
|
|
44
45
|
extra_rdoc_files:
|
45
46
|
- History.txt
|
47
|
+
- bin/.directory
|
46
48
|
- bin/translations_ennder
|
47
49
|
- lib/.directory
|
48
|
-
- lib/tasks/translations_ennder_tasks.rake
|
49
50
|
- lib/translations_ennder/.directory
|
50
51
|
- lib/translations_ennder/locales/.directory
|
51
52
|
- lib/translations_ennder/locales/en.yml
|
@@ -58,9 +59,9 @@ files:
|
|
58
59
|
- app/.directory
|
59
60
|
- app/helpers/.directory
|
60
61
|
- app/helpers/application_helper.rb
|
62
|
+
- bin/.directory
|
61
63
|
- bin/translations_ennder
|
62
64
|
- lib/.directory
|
63
|
-
- lib/tasks/translations_ennder_tasks.rake
|
64
65
|
- lib/translations_ennder.rb
|
65
66
|
- lib/translations_ennder/.directory
|
66
67
|
- lib/translations_ennder/conversions_with_i18n_label.rb
|