Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade I18n to 1.7.1 #2152

Merged
merged 1 commit into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ GEM
sysexits (~> 1.1)
health_check (3.0.0)
railties (>= 5.0)
i18n (1.7.0)
i18n (1.7.1)
concurrent-ruby (~> 1.0)
icalendar (2.6.1)
ice_cube (~> 0.16)
Expand Down
6 changes: 3 additions & 3 deletions app/helpers/translation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
module TranslationHelper

def t_manage_models(clazz)
I18n.t("pages.manage", model: clazz.model_name.human.pluralize)
I18n.t("pages.manage", model: clazz.model_name.human(count: :many))
end

def t_create_model(clazz)
I18n.t("pages.create", model: clazz.model_name.human)
end

def t_create_models(clazz)
I18n.t("pages.create", model: clazz.model_name.human.pluralize)
I18n.t("pages.create", model: clazz.model_name.human(count: :many))
end

def t_my(clazz)
I18n.t("pages.my_tab", model: clazz.model_name.human.pluralize)
I18n.t("pages.my_tab", model: clazz.model_name.human(count: :many))
end

def t_model_error(clazz, error, *options)
Expand Down
4 changes: 2 additions & 2 deletions app/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def unsuspend

def display_status
if suspended?
I18n.t("activerecord.models.account.statuses.suspended")
I18n.t("account.statuses.suspended")
else
I18n.t("activerecord.models.account.statuses.active")
I18n.t("account.statuses.active")
end
end

Expand Down
3 changes: 0 additions & 3 deletions config/locales/en.models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ en:
one: Payment Source
other: Payment Sources
owner: Owner
statuses:
active: Active
suspended: Suspended
account_user:
one: Account User
other: Account Users
Expand Down
4 changes: 4 additions & 0 deletions config/locales/models/en.account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ en:
account:
not_open: "The %{model} is not open for the required account"
missing_owner: Must have an account owner
account:
statuses:
active: Active
suspended: Suspended