i18n_linter icon indicating copy to clipboard operation
i18n_linter copied to clipboard

JSON keys

Open f19ps opened this issue 6 years ago • 2 comments

Many times, when we create custom REST calls, we define JSON parameters that need to be sent to an external REST API.

The problem here is that these JSONs contain keys defined as strings. These keys shouldn't be reported as it's not an i18n issue.

f19ps avatar Oct 04 '19 14:10 f19ps

Could you provide an example string?

megatux avatar Jan 21 '22 15:01 megatux

Could you provide an example string?

@megatux

I will quote 2 examples, one invalid and one valid:

You may be doing this:

  render json: { 'error' => 'An error has occurred.' }

which should be alerted, but... you may also find this:

payload = { 'first_name' => 'John Doe' }
ExternalService.call(payload)

where 'John Doe' is a "valid string" and should not be alerted

f19ps avatar Jan 21 '22 16:01 f19ps