HuntersKeepers
HuntersKeepers copied to clipboard
Capture Missing Translations in Test Environments
Describe the Feature
Is your feature request related to a problem? When a contributor internationalizes a page, there is no way for the maintainer to know if all new keys have translations in en.yml.
Describe the Technical Implementation of the Solution
Solution
There are two possible solutions, one is creating feature tests that for all important text, and verify it matches our test. The other solution is to turn on config.i18n.raise_on_missing_translations = true
in our test environments, so if a key is missing, the page errors. Instead of testing the content, which is likely to change, we test that there is some content for any keys used on the page. This will also make it easier to test other locales, because we only test for the presence of content on that locale.
- Please update
config\environments\development.rb
andconfig\environments\development.rb
withconfig.i18n.raise_on_missing_translations = true
.
References