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

Already on GitHub? Sign in to your account

Include the missing key in "missing interpolation argument" errors. #166

Merged
merged 1 commit into from Sep 16, 2012

Conversation

Projects
None yet
3 participants

henrik commented Sep 16, 2012

It's a bit annoying to manually compare the passed-in hash to the arguments, so we fixed it. Hope you'll merge.

Some things I noticed:

test/i18n/exceptions_test.rb had a commented-out test about including the missing key in an exception accessor. Couldn't figure out from git blame why it was commented out in the first place ("cleanup"), so I restored it.

backend/interpolation_compiler.rb did this:

        def missing_key(key)
          "raise(MissingInterpolationArgument.new(#{key}, self))"
        end

That looks like forgotten, possibly dead code. Before my pull request, the actual method profile was values, string; the key wasn't passed. I just modified it to pass {} for values, so it's about as broken as it was, but that class should probably be reviewed.

Owner

svenfuchs commented Sep 16, 2012

thanks @henrik!

looks like a good idea to me, but i'll leave this up to @tigrish :)

tigrish added a commit that referenced this pull request Sep 16, 2012

Merge pull request #166 from barsoom/key_in_missing_interpolation_arg…
…s_errors

Include the missing key in "missing interpolation argument" errors.

@tigrish tigrish merged commit 09c0aa7 into svenfuchs:master Sep 16, 2012

1 check passed

default The Travis build passed
Details
Collaborator

tigrish commented Sep 16, 2012

Good stuff, it seems so obvious!
Of course we want to see which key is missing :)

henrik commented Sep 17, 2012

:) Great, thank you!

atzorvas pushed a commit to e-travel/i18n that referenced this pull request Jan 12, 2016

Merge pull request #166 from tigrish/master
Conflicts:
	rails/locale/sr.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment