We want to create a JSON file stored in locales-obj and a JSON dict in a `<script>` element for each language, so this needs to be in the while loop.