iGEL / it

A helper for links and other html tags in your translations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better error message for 'wrong number of arguments (given 0, expected 1)'

professor opened this issue · comments

Feel free to close this issue if we don't want to solve it. I'm including it here to help the next person who sees this error message, which might be me =)

In my haste to use this gem, I didn't carefully look at the examples.

When I read this following line, I thought that I could use %{advises} for It.it when I really need to pass a label for the link %{link:**label**}. In my one of cases, my label for my link is the same text as the link, so I assumed it was optional.

en:
  copy: "Read the %{guide:Rails I18n guide} for more than %{advises} advises.

My code done in haste:

It.it "example", link: "https://example.com"

en:
  example:
    Go see %{link}'

This will give the error: 'wrong number of arguments (given 0, expected 1)'

Correct code:

It.it "example", link: "https://example.com"

en:
  example:
    'Go see %{link:https://example.com}.'

Perhaps the code could detect this situation and give a better error message.