JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Fix incorrect translation key for parameter_not_allowed.detail

Open Beginner friendly
#1,468 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.3k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

Problem

The gem is looking for the translation key parameters_not_allowed.detail (plural), but the key is correctly defined as parameter_not_allowed.detail (singular) in the code. Because of this mismatch, the translation is not found, and the default English message is shown.

Code with the Issue

Here’s the problematic code:

title: I18n.translate('jsonapi-resources.exceptions.parameters_not_allowed.detail',
                       default: "#{param} is not allowed.", param: param)
Expected Behavior

The code should look for the translation key parameter_not_allowed.detail (singular), as this is the correct key defined in the translation files. For example:

title: I18n.translate('jsonapi-resources.exceptions.parameter_not_allowed.detail',
                       default: "#{param} is not allowed.", param: param)
Solution

Update the code to use the correct translation key: parameter_not_allowed.detail (singular), ensuring it matches the key defined in the translation files.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the I18n.translate call shown in the issue and compare its lookup key with the singular key in the translation files. Done means the exception resolves the defined parameter_not_allowed.detail translation instead of falling back to the default English message; no specific file or test is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.