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

Fix incorrect translation key for parameter_not_allowed.detail #1468

Open
pozzer opened this issue Feb 28, 2025 · 0 comments · May be fixed by #1469
Open

Fix incorrect translation key for parameter_not_allowed.detail #1468

pozzer opened this issue Feb 28, 2025 · 0 comments · May be fixed by #1469

Comments

@pozzer
Copy link

pozzer commented Feb 28, 2025

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.

@pozzer pozzer linked a pull request Feb 28, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant