Skip to content

Commit

Permalink
Update update.rb to fetch active_model locale
Browse files Browse the repository at this point in the history
  • Loading branch information
pama committed Jun 8, 2022
1 parent 34a3a2b commit d2bf7e1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ en:
less_than: "must be less than %{count}"
less_than_or_equal_to: "must be less than or equal to %{count}"
other_than: "must be other than %{count}"
in: "must be in %{count}"
odd: "must be odd"
even: "must be even"
File renamed without changes.
14 changes: 10 additions & 4 deletions rails/rails5/active_support.yml → rails/rails/active_support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,25 @@ en:
delimiter: ","
# Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
precision: 3
# Determine how rounding is performed (see BigDecimal::mode)
round_mode: default
# If set to true, precision will mean the number of significant digits instead
# of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2)
significant: false
# If set, the zeros after the decimal separator will always be stripped (eg.: 1.200 will be 1.2)
# If set, the zeros after the decimal separator will always be stripped (e.g.: 1.200 will be 1.2)
strip_insignificant_zeros: false

# Used in NumberHelper.number_to_currency()
currency:
format:
# Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
# Where is the currency sign? %u is the currency unit, %n is the number (default: $5.00)
format: "%u%n"
unit: "$"
# These five are to override number.format and are optional
# These six are to override number.format and are optional
separator: "."
delimiter: ","
precision: 2
# round_mode:
significant: false
strip_insignificant_zeros: false

Expand Down Expand Up @@ -87,10 +90,11 @@ en:
# Used in NumberHelper.number_to_human_size() and NumberHelper.number_to_human()
human:
format:
# These five are to override number.format and are optional
# These six are to override number.format and are optional
# separator:
delimiter: ""
precision: 3
# round_mode:
significant: true
strip_insignificant_zeros: true
# Used in number_to_human_size()
Expand All @@ -106,6 +110,8 @@ en:
mb: "MB"
gb: "GB"
tb: "TB"
pb: "PB"
eb: "EB"
# Used in NumberHelper.number_to_human()
decimal_units:
format: "%n %u"
Expand Down
2 changes: 2 additions & 0 deletions rails/script/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
exec %(
curl -Lo '#{rails_locale_dir}/action_view.yml' https://raw.github.com/rails/rails/master/actionview/lib/action_view/locale/en.yml
curl -Lo '#{rails_locale_dir}/active_model.yml' https://raw.github.com/rails/rails/master/activemodel/lib/active_model/locale/en.yml
curl -Lo '#{rails_locale_dir}/active_record.yml' https://raw.github.com/rails/rails/master/activerecord/lib/active_record/locale/en.yml
curl -Lo '#{rails_locale_dir}/active_support.yml' https://raw.github.com/rails/rails/master/activesupport/lib/active_support/locale/en.yml
Expand Down
2 changes: 1 addition & 1 deletion rails/test/lib/key_structure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def init_backend(locale)
I18n.load_path = []
I18n.reload!

I18n.load_path += Dir[File.dirname(__FILE__) + "/../../rails5/*.yml"]
I18n.load_path += Dir[File.dirname(__FILE__) + "/../../rails/*.yml"]

path = File.dirname(__FILE__) + "/../../locale/#{locale}.rb"

Expand Down

0 comments on commit d2bf7e1

Please sign in to comment.