Skip to content

i18n: rework decorator locale keys and calls - #799

Open
nicolas-brousse wants to merge 1 commit into
nanego:masterfrom
pantographe:rework-decorators-i18n
Open

i18n: rework decorator locale keys and calls#799
nicolas-brousse wants to merge 1 commit into
nanego:masterfrom
pantographe:rework-decorators-i18n

Conversation

@nicolas-brousse

Copy link
Copy Markdown
Collaborator
  • Move decorators locales in separate file as components, and use same key composition
  • Correct missing human_attribute_name usage

Comment on lines +14 to +15
if params[:locale]
params[:locale]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't figure why you needed this change. Can you light me up?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was for test at first, to easily switch locale by adding locale=en in the URL. Maybe we could keep it, otherwise I'll remove it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure about this, but I'll say to remove it, since we don't need it, and if we do one day, then we'll add it

it { is_expected.to be_a BadgeComponent }
it { expect(badge.instance_variable_get(:@color)).to eq :danger }
it { expect(badge.content).to eq "NON TROUVÉ DANS GLPI" }
it { expect(badge.content).to eq "NOT FOUND" }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it in english now? Don't we agree to have french here? Or was it by default that we choose that?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I use human_attribute_name instead I18n.t. But I didn't check more. It's a bit wierd

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants