usagov / test-at-home

Other
8 stars 4 forks source link

Bundle translations.js with asset pipeline #297

Closed rahearn closed 2 years ago

rahearn commented 2 years ago

Switches to enable this:

  1. have i18n-js output translations.js into app/assets/builds/
  2. call the i18n export rake task as part of assets:precompile
  3. use the middleware only in development

Other changes:

  1. turned off asset compilation in ci, since we're using asset:precompile when that environment is used
  2. gitignore the i18n.js file since it is regenerated all the time.
hartsick commented 2 years ago

This is cool! What I did to verify locally:

  1. Run rake assets:precompile
  2. Verify that there is a translations.js file built to public/javascripts
  3. Switch development.rb to not use asset pipeline: config.assets.compile = false, verify translations show up across environments