Class: RailsAiBridge::Doctor::Checkers::I18nChecker
- Inherits:
-
BaseChecker
- Object
- BaseChecker
- RailsAiBridge::Doctor::Checkers::I18nChecker
- Defined in:
- lib/rails_ai_bridge/doctor/checkers/i18n_checker.rb
Overview
Verifies +config/locales+ contains YAML locale files.
Instance Attribute Summary
Attributes inherited from BaseChecker
Instance Method Summary collapse
-
#call ⇒ Doctor::Check
+:pass+ when locale files exist; +:warn+ otherwise.
Methods inherited from BaseChecker
Constructor Details
This class inherits a constructor from RailsAiBridge::Doctor::Checkers::BaseChecker
Instance Method Details
#call ⇒ Doctor::Check
Returns +:pass+ when locale files exist; +:warn+ otherwise.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rails_ai_bridge/doctor/checkers/i18n_checker.rb', line 9 def call locales_path = File.join(app.root, 'config/locales', '**/*.{yml,yaml}') locales = Dir.glob(locales_path) check( 'I18n', locales.any?, pass: { message: "#{locales.size} locale files found" }, fail: { status: :warn, message: 'No locale files found in config/locales/', fix: 'Add locale files for internationalization support' } ) end |