mozilla/fxa-content-server — pull request #674 by shane-tomlinson (2014-03-05 18:50:14+00:00)
Title: WIP: Issue 634 import tos pp

This includes the fix in #670.

@zaach - I'm not fully sure where to go with this, this isn't even close to being ready, but I could use some help.

I set up two new grunt tasks that are not yet part of the build:
- `l10n-fetch-tos-pp` fetches the legal repo with the translated .md files. Contents are placed into the `tos-pp` subdirectory.
- `marked` converts the .md files and places them into `server/templates/terms` and `server/templates/privacy`, one file per translation.

I modify the `/legal/terms` and `/legal/privacy` routes to be handled by the backend. The route depends on `req.lang`, which is always set to `en-US`, I believe i18n-abide needs to be set up correctly, or I need to do some trickery to find the best language. Note, unless you browse to these links directly, the front end JS code still handles them.

Where I could use some guidance:
* I'm not comfortable placing the git repo into the `tos-pp` subdirectory. I put it into `.tmp, but as soon as I start the server, the repo is wiped out. I tried to update the `clean` task to not delete my directory, but it refused to listen.
* Placing the translated .html files into `server/templates/privacy` and `server/templates/terms` seems equally wrong. I tried to use handlebars partials but that seemed to be a dead end - I wasn't sure how to dynamically generate a partial name, nor was I sure where to register the partial.
* Users who click on one of the terms or privacy links from the client will need to see translated text - are we going to send them out of the app to see the translated page, or should we load the translated html dynamically and insert it into the DOM?