Skip to content

Commit

Permalink
fix: translate language keys if passed in to formatApiResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Jul 9, 2021
1 parent 7036c37 commit 415416d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/controllers/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ async function generateBannedResponse(res) {
}

helpers.generateError = async (statusCode, message) => {
if (message && message.startsWith('[[')) {
message = await translator.translate(message);
}

const payload = {
status: {
code: 'internal-server-error',
Expand Down

0 comments on commit 415416d

Please sign in to comment.