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

Why I18n.translate method accepts null values but no empty string? #207

Open
pedrocss opened this issue Jun 12, 2013 · 3 comments
Open

Why I18n.translate method accepts null values but no empty string? #207

pedrocss opened this issue Jun 12, 2013 · 3 comments
Labels
Milestone

Comments

@pedrocss
Copy link

If translate method raise an exception with empty string, so nil key should raise too?

This works:
> I18n.t(nil) "translation missing: pt-BR.no key"
but this not:
> I18n.t("") I18n::ArgumentError: I18n::ArgumentError

See also:
https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L151
#136

@tigrish
Copy link
Collaborator

tigrish commented Jun 13, 2013

I think you're right, nil key should raise an I18n::ArgumentError.
Pull requests welcome, just sayin' :)

On 12 Jun 2013, at 16:24, Pedro Souza notifications@github.com wrote:

If translate method raise an exception with empty string, so nil key should raise too?

This works:

I18n.t(nil)
"translation missing: pt-BR.no key"
but this not:
I18n.t("")
I18n::ArgumentError: I18n::ArgumentError

See also:
https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L151
#136


Reply to this email directly or view it on GitHub.

@ahmetabdi
Copy link

👍

@radar
Copy link
Collaborator

radar commented Nov 17, 2016

This will be fixed by #236.

@radar radar added this to the 0.8.0 milestone Nov 17, 2016
@radar radar added the waiting label Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants