JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
Fix incorrect translation key for parameter_not_allowed.detail
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Ruby
- Sterne
- 2.3k
- Forks
- 546
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne bei dem im Issue gezeigten Aufruf von I18n.translate und vergleiche seinen Lookup-Schlüssel mit dem Singularschlüssel in den Übersetzungsdateien. Erledigt ist die Aufgabe, wenn die Exception die definierte parameter_not_allowed.detail-Übersetzung auflöst, statt auf die standardmäßige englische Nachricht zurückzufallen; es wird keine bestimmte Datei oder kein bestimmter Test genannt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- ruby
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 85/100