Fixes login-issues via JSON-API

When using the JSON-API the translations-Object is not set in a global
scope but inside a function and is therefore not globally available.
Merge pull request #153 from heiglandreas/fixLoginViaJsonAPI

Fixes login-issues via JSON-API