Implement Locale inheritance in JavaScript.

We add a fallback to the same language locale for the main site if the
site specific locale isn't filled in.