fast_gettext 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.5
|
data/fast_gettext.gemspec
CHANGED
@@ -17,12 +17,19 @@ module FastGettext::TranslationRepository
|
|
17
17
|
@@available_locales ||= TranslationText.count(:group=>:locale).keys.sort
|
18
18
|
end
|
19
19
|
|
20
|
-
#
|
20
|
+
# get polymorphic_url FastGettext::... namespace free
|
21
|
+
# !! copied in translation_text.rb
|
22
|
+
def self.name
|
23
|
+
'TranslationKey'
|
24
|
+
end
|
25
|
+
|
21
26
|
def self.model_name
|
22
|
-
if defined? ActiveSupport::ModelName
|
23
|
-
ActiveSupport::ModelName.new(
|
24
|
-
|
25
|
-
|
27
|
+
if defined? ActiveSupport::ModelName # Rails 2
|
28
|
+
ActiveSupport::ModelName.new(name)
|
29
|
+
elsif defined? ActiveModel::Name # Rails 3
|
30
|
+
ActiveModel::Name.new(self)
|
31
|
+
else # Fallback
|
32
|
+
name
|
26
33
|
end
|
27
34
|
end
|
28
35
|
end
|
@@ -4,6 +4,22 @@ module FastGettext::TranslationRepository
|
|
4
4
|
belongs_to :key, :class_name=>'TranslationKey'
|
5
5
|
validates_presence_of :locale
|
6
6
|
validates_uniqueness_of :locale, :scope=>:translation_key_id
|
7
|
+
|
8
|
+
# get polymorphic_url FastGettext::... namespace free
|
9
|
+
# !! copied in translation_key.rb
|
10
|
+
def self.name
|
11
|
+
'TranslationKey'
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.model_name
|
15
|
+
if defined? ActiveSupport::ModelName # Rails 2
|
16
|
+
ActiveSupport::ModelName.new(name)
|
17
|
+
elsif defined? ActiveModel::Name # Rails 3
|
18
|
+
ActiveModel::Name.new(self)
|
19
|
+
else # Fallback
|
20
|
+
name
|
21
|
+
end
|
22
|
+
end
|
7
23
|
end
|
8
24
|
end
|
9
25
|
end
|