You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The enforce_available_locales is set to true by default.
When hitting the grape api with an invalid request, grape sets the locale to the FALLBACK_LOCALE which is :en and crashes due to enforce_available_locales being true like so:
Hope it's ok to jump in here as there hasn't been a reply from the original reporter in a while.
I made a PR here #1796, the first commit confirms that indeed an exception is raised if available locales are enforced but don't contain :en. Second commit has a fix that checks if the available locales are enforced and fallback locale is available and if not, returns the translation string instead of crashing.
My rails app is configured this way:
The
enforce_available_locales
is set totrue
by default.When hitting the grape api with an invalid request, grape sets the locale to the
FALLBACK_LOCALE
which is:en
and crashes due toenforce_available_locales
beingtrue
like so:In my opinion grape should check if
:en
is available and if not then just return the key in the error response instead of crashing miserablyThe text was updated successfully, but these errors were encountered: