mozilla/kitsune — pull request #1827 by mythmon (2014-02-19 01:08:55+00:00)
Title: [Bug 966337] Localize TOC header at render time.

The string "Table of Contents" is generated by WikiParser. WikiParser has no idea what localization is.

Old showfor, we did some weird stuff with the table of contents that made it render in JS, and thus write "Table of Contents" in the write language. New showfor just shows and hides the DOM that is already there, generated by the parser. I think it's better.

So instead of fiddling with the TOC on the client side, this fiddles with it on the server side, once, when we render the page.

To test:

* Check http://localhost:8080/es/kb/visualiza-archivos-pdf-en-firefox-sin-descargarlos
* Notice the unlocalized TOC.

```python
from kitsune.wiki.models import Document
d = Document.objects.get(slug='visualiza-archivos-pdf-en-firefox-sin-descargarlos')
d.html = d.parse_and_calculate_links()
d.save()
```

* Clear caches.
* Check the article again, it should be good now.

r?