rootstrap / i18n_linter

Rails i18n Linter Gem
https://rootstrap.com
MIT License
44 stars 2 forks source link

JSON keys #22

Open f19ps opened 4 years ago

f19ps commented 4 years ago

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.

megatux commented 2 years ago

Could you provide an example string?

f19ps commented 2 years ago

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