protected function getMessagesJson()
    {
        $messages = MessageCachingService::getMessagesJson();
        $messages = $this->ensureBackwardsCompatibility($messages);

        $contents  = 'Lang.addMessages(' . $messages . ');';

        return $contents;
    }