gettext_simple_rails 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gettext_simple_rails/cache_handler.rb +5 -3
- data/lib/gettext_simple_rails/i18n_injector.rb +7 -65
- data/lib/gettext_simple_rails/translators/active_record_attributes_translator.rb +36 -0
- data/lib/gettext_simple_rails/translators/{active_record_translator.rb → active_record_validations_translator.rb} +5 -3
- data/lib/gettext_simple_rails/translators/globalize_translator.rb +32 -0
- data/lib/gettext_simple_rails/version.rb +1 -1
- data/lib/tasks/gettext_simple_rails_tasks.rake +0 -42
- data/spec/{active_record_spec.rb → active_record_validations_spec.rb} +2 -2
- data/spec/dummy/app/models/user.rb +2 -1
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/locales_gettext/static_translation_file.json +1 -1
- data/spec/dummy/db/migrate/20140515092420_create_user_translations.rb +11 -0
- data/spec/dummy/db/schema.rb +9 -5
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb +40 -0
- data/spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb +18 -0
- data/spec/dummy/lib/gettext_simple_rails/date_translator_translations.rb +60 -0
- data/spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb +6 -0
- data/spec/dummy/lib/gettext_simple_rails/number_translator_translations.rb +48 -0
- data/spec/dummy/log/test.log +440 -0
- data/spec/gettext_simple_rails_spec.rb +10 -11
- data/spec/globalize_translator_spec.rb +20 -0
- metadata +35 -13
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/lib/gettext_simple_rails/models/role_model_translations.rb +0 -21
- data/spec/dummy/lib/gettext_simple_rails/models/user_model_translations.rb +0 -22
- data/spec/dummy/log/development.log +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e9f89b39cca1dd44dd7cb081be7142f23be1521
|
4
|
+
data.tar.gz: f596c1a7eb5cf390432b7bb576e933df493ad658
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25b0ad6a03fc80a953b28ffc70009addf5e7aa1d07619a1f3a4ff34a681718a96c3232814a0069de4f77872ba228db6c3d054fd0da600b18d24ebe12cdb0f556
|
7
|
+
data.tar.gz: b779e97c24ce3152dcb069533b886c30789749e8658b45300a09379a573b42e725c81d3b9d3a5a2028cc3668d350e74c02a0fc38dc383c5e460859e5b61db21e
|
@@ -7,8 +7,11 @@ class GettextSimpleRails::CacheHandler
|
|
7
7
|
default_path_file = "#{Rails.root}/config/locales_gettext/#{locale}/LC_MESSAGES/default.po"
|
8
8
|
next unless File.exists?(default_path_file)
|
9
9
|
time = File.mtime(default_path_file)
|
10
|
-
|
11
|
-
|
10
|
+
|
11
|
+
if newest_time == nil || time > newest_time
|
12
|
+
newest_time = time
|
13
|
+
newest_path = default_path_file
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
return newest_path
|
@@ -35,7 +38,6 @@ class GettextSimpleRails::CacheHandler
|
|
35
38
|
gs.register_kernel_methods
|
36
39
|
|
37
40
|
injector = GettextSimpleRails::I18nInjector.new(:store_in_hash => true)
|
38
|
-
injector.inject_model_translations(gs)
|
39
41
|
injector.inject_translator_translations(gs)
|
40
42
|
|
41
43
|
File.open(static_cache_file_path, "w") do |fp|
|
@@ -5,11 +5,11 @@ class GettextSimpleRails::I18nInjector
|
|
5
5
|
@args = args
|
6
6
|
@debug = args[:debug]
|
7
7
|
@i18n_backend = I18n.config.backend
|
8
|
-
@store_hash = {}
|
8
|
+
@store_hash = {}
|
9
9
|
end
|
10
10
|
|
11
11
|
def inject_translator_translations(gettext_simple)
|
12
|
-
@
|
12
|
+
@store_hash = {}
|
13
13
|
|
14
14
|
GettextSimpleRails::Translators.load_all.each do |translator_data|
|
15
15
|
translator = translator_data[:class].new
|
@@ -21,70 +21,16 @@ class GettextSimpleRails::I18nInjector
|
|
21
21
|
injector_recursive gettext_simple, locale, translator.translations
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
GettextSimpleRails::ModelInspector.model_classes do |inspector|
|
28
|
-
model = {}
|
29
|
-
attributes = {}
|
30
|
-
|
31
|
-
data = {
|
32
|
-
"activerecord" => {
|
33
|
-
"models" => {
|
34
|
-
inspector.snake_name => model
|
35
|
-
},
|
36
|
-
"attributes" => {
|
37
|
-
inspector.snake_name => attributes
|
38
|
-
}
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
I18n.available_locales.each do |locale|
|
43
|
-
locale = locale.to_s
|
44
|
-
|
45
|
-
unless gettext_simple.locale_exists?(locale)
|
46
|
-
debug "Skipping locale because it hasn't been loaded into GettextSimple: #{locale}" if @debug
|
47
|
-
next
|
48
|
-
end
|
49
|
-
|
50
|
-
debug "Loading locale: #{locale}" if @debug
|
51
|
-
|
52
|
-
one_translation = gettext_simple.translate_with_locale(locale, inspector.gettext_key_one)
|
53
|
-
if one_translation != inspector.gettext_key_one
|
54
|
-
model["one"] = one_translation
|
55
|
-
end
|
56
|
-
|
57
|
-
other_translation = gettext_simple.translate_with_locale(locale, inspector.gettext_key_other)
|
58
|
-
if other_translation != inspector.gettext_key_other
|
59
|
-
model["other"] = other_translation
|
60
|
-
end
|
61
|
-
|
62
|
-
inspector.attributes do |attribute|
|
63
|
-
attribute_translation = gettext_simple.translate_with_locale(locale, attribute.gettext_key)
|
64
|
-
if attribute_translation != attribute.gettext_key
|
65
|
-
debug "Translating #{inspector.snake_name}.#{attribute.name} to #{attribute_translation}" if @debug
|
66
|
-
attributes[attribute.name.to_s] = attribute_translation
|
67
|
-
else
|
68
|
-
debug "Skipping #{inspector.snake_name}.#{attribute.name}" if @debug
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
inspector.relationships do |name, reflection|
|
73
|
-
relationship_translation = gettext_simple.translate_with_locale(locale, inspector.relationship_gettext_key(name))
|
74
|
-
if relationship_translation != inspector.relationship_gettext_key(name)
|
75
|
-
attributes[name.to_s] = relationship_translation
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
store_translations(locale, data)
|
80
|
-
end
|
24
|
+
|
25
|
+
@store_hash.each do |locale, language_hash|
|
26
|
+
@i18n_backend.store_translations(locale.to_sym, language_hash)
|
81
27
|
end
|
82
28
|
end
|
83
29
|
|
84
30
|
def inject_from_static_translation_file(args)
|
85
31
|
translation_hash = JSON.parse(File.read(args[:path]))
|
86
32
|
translation_hash.each do |locale, language_hash|
|
87
|
-
store_translations(locale, language_hash)
|
33
|
+
@i18n_backend.store_translations(locale.to_sym, language_hash)
|
88
34
|
end
|
89
35
|
end
|
90
36
|
|
@@ -149,10 +95,6 @@ private
|
|
149
95
|
end
|
150
96
|
|
151
97
|
def store_translations(locale, translation_hash)
|
152
|
-
|
153
|
-
@store_hash.deep_merge!({locale.to_sym => translation_hash})
|
154
|
-
else
|
155
|
-
@i18n_backend.store_translations(locale.to_sym, translation_hash)
|
156
|
-
end
|
98
|
+
@store_hash.deep_merge!({locale.to_sym => translation_hash})
|
157
99
|
end
|
158
100
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
class GettextSimpleRails::Translators::ActiveRecordAttributesTranslator
|
2
|
+
def detected?
|
3
|
+
::Kernel.const_defined?("ActiveRecord")
|
4
|
+
end
|
5
|
+
|
6
|
+
def translations
|
7
|
+
@translations_hash = {
|
8
|
+
"activerecord" => {
|
9
|
+
"attributes" => {},
|
10
|
+
"models" => {}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
attributes_hash = @translations_hash["activerecord"]["attributes"]
|
14
|
+
models_hash = @translations_hash["activerecord"]["models"]
|
15
|
+
|
16
|
+
GettextSimpleRails::ModelInspector.model_classes do |inspector|
|
17
|
+
lower_class_name = StringCases.camel_to_snake(inspector.clazz.name)
|
18
|
+
models_hash[lower_class_name] = {
|
19
|
+
"one" => inspector.clazz.name,
|
20
|
+
"other" => inspector.clazz.name
|
21
|
+
}
|
22
|
+
attributes_hash[lower_class_name] = {} unless attributes_hash.key?(lower_class_name)
|
23
|
+
attributes = attributes_hash[lower_class_name]
|
24
|
+
|
25
|
+
inspector.attributes do |attribute|
|
26
|
+
attributes[attribute.name.to_s] = attribute.name.to_s
|
27
|
+
end
|
28
|
+
|
29
|
+
inspector.relationships do |name, reflection|
|
30
|
+
attributes[name.to_s] = name.to_s
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
return @translations_hash
|
35
|
+
end
|
36
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
class GettextSimpleRails::Translators::
|
1
|
+
class GettextSimpleRails::Translators::ActiveRecordValidationsTranslator
|
2
2
|
def detected?
|
3
|
-
|
3
|
+
::Kernel.const_defined?("ActiveRecord")
|
4
4
|
end
|
5
5
|
|
6
6
|
def translations
|
@@ -8,7 +8,7 @@ class GettextSimpleRails::Translators::ActiveRecordTranslator
|
|
8
8
|
"activerecord" => {
|
9
9
|
"errors" => {
|
10
10
|
"messages" => {
|
11
|
-
"record_invalid" => "Invalid record"
|
11
|
+
"record_invalid" => "Invalid record: %{errors}"
|
12
12
|
},
|
13
13
|
"models" => {}
|
14
14
|
}
|
@@ -29,6 +29,8 @@ private
|
|
29
29
|
attributes_hash = @translations_hash["activerecord"]["errors"]["models"][clazz_snake_name]["attributes"]
|
30
30
|
|
31
31
|
inspector.clazz._validators.each do |attribute_name, validators|
|
32
|
+
attribute_name = attribute_name.to_s
|
33
|
+
|
32
34
|
validators.each do |validator|
|
33
35
|
attributes_hash[attribute_name] = {} unless attributes_hash.key?(attribute_name)
|
34
36
|
attribute_hash = attributes_hash[attribute_name]
|
@@ -0,0 +1,32 @@
|
|
1
|
+
class GettextSimpleRails::Translators::GlobalizeTranslator
|
2
|
+
def detected?
|
3
|
+
return ::Kernel.const_defined?("Globalize")
|
4
|
+
end
|
5
|
+
|
6
|
+
def translations
|
7
|
+
@translations_hash = {
|
8
|
+
"activerecord" => {
|
9
|
+
"attributes" => {}
|
10
|
+
}
|
11
|
+
}
|
12
|
+
attributes = @translations_hash["activerecord"]["attributes"]
|
13
|
+
|
14
|
+
GettextSimpleRails::ModelInspector.model_classes do |inspector|
|
15
|
+
next unless inspector.clazz.respond_to?(:globalize_migrator)
|
16
|
+
|
17
|
+
class_lower_name = StringCases.camel_to_snake(inspector.clazz.name)
|
18
|
+
translate_class_name = "#{inspector.clazz.name}::Translation"
|
19
|
+
translate_class = translate_class_name.constantize
|
20
|
+
|
21
|
+
id_column_name = "#{class_lower_name}_id"
|
22
|
+
translate_columns = translate_class.column_names - ["id", "locale", "created_at", "updated_at", id_column_name]
|
23
|
+
|
24
|
+
translate_columns.each do |column_name|
|
25
|
+
attributes[class_lower_name] = {} unless attributes.key?(class_lower_name)
|
26
|
+
attributes[class_lower_name][column_name] = column_name
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
return @translations_hash
|
31
|
+
end
|
32
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
namespace :gettext_simple_rails do
|
2
2
|
task "all" => :environment do
|
3
3
|
Rake::Task["gettext_simple_rails:generate_translator_files"].execute
|
4
|
-
Rake::Task["gettext_simple_rails:generate_model_translation_files"].execute
|
5
4
|
end
|
6
5
|
|
7
6
|
task "generate_translator_files" => :environment do
|
@@ -27,47 +26,6 @@ namespace :gettext_simple_rails do
|
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
30
|
-
task "generate_model_translation_files" => :environment do
|
31
|
-
GettextSimpleRails::ModelInspector.model_classes do |inspector|
|
32
|
-
translation_path = "#{GettextSimpleRails.translation_dir}/models/#{inspector.snake_name}_model_translations.rb"
|
33
|
-
FileUtils.mkdir_p(File.dirname(translation_path)) unless File.exists?(File.dirname(translation_path))
|
34
|
-
|
35
|
-
File.open(translation_path, "w") do |fp|
|
36
|
-
fp.puts "class GettextSimpleRails::UserModelTranslations"
|
37
|
-
fp.puts " def self.attribute_translations"
|
38
|
-
|
39
|
-
inspector.attributes do |attribute|
|
40
|
-
fp.puts " puts _('#{attribute.gettext_key}')"
|
41
|
-
end
|
42
|
-
|
43
|
-
fp.puts " end"
|
44
|
-
fp.puts ""
|
45
|
-
fp.puts " def self.relationship_translations"
|
46
|
-
|
47
|
-
inspector.relationships do |name, relationship|
|
48
|
-
fp.puts " puts _('#{inspector.relationship_gettext_key(name)}')"
|
49
|
-
end
|
50
|
-
|
51
|
-
fp.puts " end"
|
52
|
-
fp.puts ""
|
53
|
-
fp.puts " def self.paperclip_attachments"
|
54
|
-
|
55
|
-
inspector.paperclip_attachments do |name|
|
56
|
-
fp.puts " puts _('#{inspector.relationship_gettext_key(name)}')"
|
57
|
-
end
|
58
|
-
|
59
|
-
fp.puts " end"
|
60
|
-
fp.puts ""
|
61
|
-
fp.puts " def self.model_name"
|
62
|
-
fp.puts " puts _('#{inspector.gettext_key}.one')"
|
63
|
-
fp.puts " puts _('#{inspector.gettext_key}.other')"
|
64
|
-
fp.puts " end"
|
65
|
-
|
66
|
-
fp.puts "end"
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
29
|
task "create" => :environment do
|
72
30
|
require "fileutils"
|
73
31
|
I18n.available_locales.each do |locale|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe GettextSimpleRails::Translators::
|
3
|
+
describe GettextSimpleRails::Translators::ActiveRecordValidationsTranslator do
|
4
4
|
before do
|
5
5
|
# Make it possible to call the Rake task.
|
6
6
|
::Dummy::Application.load_tasks
|
@@ -13,7 +13,7 @@ describe GettextSimpleRails::Translators::ActiveRecordTranslator do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should generate translations for validations" do
|
16
|
-
filepath = "#{GettextSimpleRails.translation_dir}/
|
16
|
+
filepath = "#{GettextSimpleRails.translation_dir}/active_record_validations_translator_translations.rb"
|
17
17
|
cont = File.read(filepath)
|
18
18
|
cont.should include "_('activerecord.errors.models.user.attributes.name.too_short')"
|
19
19
|
cont.should include "_('activerecord.errors.models.user.attributes.name.invalid')"
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require "email_validator"
|
2
2
|
|
3
3
|
class User < ActiveRecord::Base
|
4
|
+
translates :title
|
5
|
+
|
4
6
|
has_many :roles
|
5
7
|
|
6
8
|
validates :name, :length => {:in => 2..255}
|
7
9
|
validates :name, :uniqueness => true, :presence => true
|
8
10
|
validates :name, :format => {:with => /\A[A-z]+\Z/}
|
9
|
-
|
10
11
|
validates :email, :email => true
|
11
12
|
end
|
@@ -1 +1 @@
|
|
1
|
-
{"
|
1
|
+
{"da":{"activerecord":{"errors":{"models":{"user":{"attributes":{"name":{"too_short":"er for kort. Minimum er %{count}"}}}}}},"date":{"day_names":[],"abbr_day_names":[],"month_names":[],"abbr_month_names":[]}},"en":{"date":{"day_names":[],"abbr_day_names":[],"month_names":[],"abbr_month_names":[]}}}
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,22 +11,26 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20140515092420) do
|
15
15
|
|
16
|
-
create_table "
|
16
|
+
create_table "roles", force: true do |t|
|
17
17
|
t.string "role"
|
18
18
|
t.integer "user_id"
|
19
19
|
t.datetime "created_at"
|
20
20
|
t.datetime "updated_at"
|
21
21
|
end
|
22
22
|
|
23
|
-
create_table "
|
24
|
-
t.
|
25
|
-
t.
|
23
|
+
create_table "user_translations", force: true do |t|
|
24
|
+
t.integer "user_id", null: false
|
25
|
+
t.string "locale", null: false
|
26
26
|
t.datetime "created_at"
|
27
27
|
t.datetime "updated_at"
|
28
|
+
t.string "title"
|
28
29
|
end
|
29
30
|
|
31
|
+
add_index "user_translations", ["locale"], name: "index_user_translations_on_locale"
|
32
|
+
add_index "user_translations", ["user_id"], name: "index_user_translations_on_user_id"
|
33
|
+
|
30
34
|
create_table "users", force: true do |t|
|
31
35
|
t.string "name"
|
32
36
|
t.date "birthday_at"
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -0,0 +1,40 @@
|
|
1
|
+
class GettextSimpleRails::MonthNames
|
2
|
+
def translations
|
3
|
+
#. Default value: id
|
4
|
+
_('activerecord.attributes.role.id')
|
5
|
+
#. Default value: role
|
6
|
+
_('activerecord.attributes.role.role')
|
7
|
+
#. Default value: user_id
|
8
|
+
_('activerecord.attributes.role.user_id')
|
9
|
+
#. Default value: created_at
|
10
|
+
_('activerecord.attributes.role.created_at')
|
11
|
+
#. Default value: updated_at
|
12
|
+
_('activerecord.attributes.role.updated_at')
|
13
|
+
#. Default value: user
|
14
|
+
_('activerecord.attributes.role.user')
|
15
|
+
#. Default value: id
|
16
|
+
_('activerecord.attributes.user.id')
|
17
|
+
#. Default value: name
|
18
|
+
_('activerecord.attributes.user.name')
|
19
|
+
#. Default value: birthday_at
|
20
|
+
_('activerecord.attributes.user.birthday_at')
|
21
|
+
#. Default value: age
|
22
|
+
_('activerecord.attributes.user.age')
|
23
|
+
#. Default value: created_at
|
24
|
+
_('activerecord.attributes.user.created_at')
|
25
|
+
#. Default value: updated_at
|
26
|
+
_('activerecord.attributes.user.updated_at')
|
27
|
+
#. Default value: translations
|
28
|
+
_('activerecord.attributes.user.translations')
|
29
|
+
#. Default value: roles
|
30
|
+
_('activerecord.attributes.user.roles')
|
31
|
+
#. Default value: Role
|
32
|
+
_('activerecord.models.role.one')
|
33
|
+
#. Default value: Role
|
34
|
+
_('activerecord.models.role.other')
|
35
|
+
#. Default value: User
|
36
|
+
_('activerecord.models.user.one')
|
37
|
+
#. Default value: User
|
38
|
+
_('activerecord.models.user.other')
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class GettextSimpleRails::MonthNames
|
2
|
+
def translations
|
3
|
+
#. Default value: Invalid record: %{errors}
|
4
|
+
_('activerecord.errors.messages.record_invalid')
|
5
|
+
#. Default value: is too short. The minimum is %{count}
|
6
|
+
_('activerecord.errors.models.user.attributes.name.too_short')
|
7
|
+
#. Default value: is too long. The maximum is %{count}
|
8
|
+
_('activerecord.errors.models.user.attributes.name.too_long')
|
9
|
+
#. Default value: has already been taken
|
10
|
+
_('activerecord.errors.models.user.attributes.name.taken')
|
11
|
+
#. Default value: cannot be blank
|
12
|
+
_('activerecord.errors.models.user.attributes.name.blank')
|
13
|
+
#. Default value: is invalid
|
14
|
+
_('activerecord.errors.models.user.attributes.name.invalid')
|
15
|
+
#. Default value: is invalid
|
16
|
+
_('activerecord.errors.models.user.attributes.email.invalid')
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
class GettextSimpleRails::MonthNames
|
2
|
+
def translations
|
3
|
+
#. Default value: %Y-%m-%d
|
4
|
+
_('date.formats.default')
|
5
|
+
#. Default value: %b %d
|
6
|
+
_('date.formats.short')
|
7
|
+
#. Default value: %B %d, %Y
|
8
|
+
_('date.formats.long')
|
9
|
+
_('date.day_names.0')
|
10
|
+
_('date.day_names.1')
|
11
|
+
_('date.day_names.2')
|
12
|
+
_('date.day_names.3')
|
13
|
+
_('date.day_names.4')
|
14
|
+
_('date.day_names.5')
|
15
|
+
_('date.day_names.6')
|
16
|
+
_('date.abbr_day_names.0')
|
17
|
+
_('date.abbr_day_names.1')
|
18
|
+
_('date.abbr_day_names.2')
|
19
|
+
_('date.abbr_day_names.3')
|
20
|
+
_('date.abbr_day_names.4')
|
21
|
+
_('date.abbr_day_names.5')
|
22
|
+
_('date.abbr_day_names.6')
|
23
|
+
_('date.month_names.0')
|
24
|
+
_('date.month_names.1')
|
25
|
+
_('date.month_names.2')
|
26
|
+
_('date.month_names.3')
|
27
|
+
_('date.month_names.4')
|
28
|
+
_('date.month_names.5')
|
29
|
+
_('date.month_names.6')
|
30
|
+
_('date.month_names.7')
|
31
|
+
_('date.month_names.8')
|
32
|
+
_('date.month_names.9')
|
33
|
+
_('date.month_names.10')
|
34
|
+
_('date.month_names.11')
|
35
|
+
_('date.month_names.12')
|
36
|
+
_('date.abbr_month_names.0')
|
37
|
+
_('date.abbr_month_names.1')
|
38
|
+
_('date.abbr_month_names.2')
|
39
|
+
_('date.abbr_month_names.3')
|
40
|
+
_('date.abbr_month_names.4')
|
41
|
+
_('date.abbr_month_names.5')
|
42
|
+
_('date.abbr_month_names.6')
|
43
|
+
_('date.abbr_month_names.7')
|
44
|
+
_('date.abbr_month_names.8')
|
45
|
+
_('date.abbr_month_names.9')
|
46
|
+
_('date.abbr_month_names.10')
|
47
|
+
_('date.abbr_month_names.11')
|
48
|
+
_('date.abbr_month_names.12')
|
49
|
+
#. Default value: %a, %d %b %Y %H:%M:%S %z
|
50
|
+
_('time.formats.default')
|
51
|
+
#. Default value: %d %b %H:%M
|
52
|
+
_('time.formats.short')
|
53
|
+
#. Default value: %B %d, %Y %H:%M
|
54
|
+
_('time.formats.long')
|
55
|
+
#. Default value: am
|
56
|
+
_('time.am')
|
57
|
+
#. Default value: pm
|
58
|
+
_('time.pm')
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
class GettextSimpleRails::MonthNames
|
2
|
+
def translations
|
3
|
+
#. Default value: ,
|
4
|
+
_('number.currency.format.delimiter')
|
5
|
+
#. Default value: %n %u
|
6
|
+
_('number.currency.format.format')
|
7
|
+
#. Default value: .
|
8
|
+
_('number.currency.format.separator')
|
9
|
+
#. Default value: $
|
10
|
+
_('number.currency.format.unit')
|
11
|
+
#. Default value: ,
|
12
|
+
_('number.format.delimiter')
|
13
|
+
#. Default value: .
|
14
|
+
_('number.format.separator')
|
15
|
+
#. Default value: %n %u
|
16
|
+
_('number.human.decimal_units.format')
|
17
|
+
#. Default value: Billion
|
18
|
+
_('number.human.decimal_units.units.billion')
|
19
|
+
#. Default value: Million
|
20
|
+
_('number.human.decimal_units.units.million')
|
21
|
+
#. Default value: Quadrillion
|
22
|
+
_('number.human.decimal_units.units.quadrillion')
|
23
|
+
#. Default value: Thousand
|
24
|
+
_('number.human.decimal_units.units.thousand')
|
25
|
+
#. Default value: Trillion
|
26
|
+
_('number.human.decimal_units.units.trillion')
|
27
|
+
#. Default value:
|
28
|
+
_('number.human.decimal_units.units.unit')
|
29
|
+
#. Default value:
|
30
|
+
_('number.human.format.delimiter')
|
31
|
+
#. Default value: %n %u
|
32
|
+
_('number.human.storage_units.format')
|
33
|
+
#. Default value: Byte
|
34
|
+
_('number.human.storage_units.units.byte.one')
|
35
|
+
#. Default value: Bytes
|
36
|
+
_('number.human.storage_units.units.byte.other')
|
37
|
+
#. Default value: GB
|
38
|
+
_('number.human.storage_units.units.gb')
|
39
|
+
#. Default value: KB
|
40
|
+
_('number.human.storage_units.units.kb')
|
41
|
+
#. Default value: MB
|
42
|
+
_('number.human.storage_units.units.mb')
|
43
|
+
#. Default value: TB
|
44
|
+
_('number.human.storage_units.units.tb')
|
45
|
+
#. Default value:
|
46
|
+
_('number.percentage.format.delimiter')
|
47
|
+
end
|
48
|
+
end
|