Skip to content

Add a cop to enforce internationalization #624

Closed
@pirj

Description

#620 brought up a problem with user-facing string appearing directly in models.

class Foo < ApplicationRecord
  belongs_to :bar
  validates :bar, presence: { message: 'show me the way to the next whiskey bar' }
end

Describe the solution you'd like

Add a cop that enforces https://rails.rubystyle.guide/#locale-texts, at least for basic cases for the start.

No strings or other locale specific settings should be used in the views, models and controllers. These texts should be moved to the locale files in the config/locales directory.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions