mozilla/fxa-content-server — pull request #1092 by shane-tomlinson (2014-05-12 14:56:58+00:00)
Title: Fonts again pregenerate

@nchapman, @zaach and @pdehaan - here is a different version of #1087. This one still uses grunt-connect-fonts to generate locale-specific CSS and extract font files. The difference here is a copy of the static pages are generated for each locale. This allows grunt to pre-generate locale specific CSS files which are included into the final page. This concept can be extended to do two things:

1) Pre-translate all static pages
2) Create JS files which contain the translations to avoid the extra request.

Additional build steps and a new middleware are needed to make this happen.

1) We have to create @font-face CSS declarations for each locale. The @font-face declarations contain links to the correct font for that locale.
2) We create copies of each of the static pages in `server/templates/pages/src` into `server/templates/pages/dist/
3) requirejs must replace require.js script with production version for each page from 2
4) usemin must replace dev CSS with the appropriate localized production CSS.

A new middlware, `/lib/localized-render.js`, is added that renders the appropriate template for the locale.