protected function getDictionaryInformation($control, &$translations)
    {
        foreach ($control->getChildren() as $child) {
            if (($child instanceof Label || $child instanceof FmlLabel) && $child->getTranslate()) {
                $id = $child->getTextId();

                if (!isset($this->cachedMessages[$id])) {
                    $textId = 'exp_'.md5($id);

                    $messages = $this->translationHelper->getTranslations($child->getTextId(), []);
                    $translations[$textId] = $messages;
                    $this->cachedMessages[$textId] = $messages;

                    // Replaces with text id that can be used in the xml.
                    $child->setTextId($textId);
                } else {
                    $translations[$id] = $this->cachedMessages[$id];
                }
            } else {
                if ($child instanceof Container) {
                    $this->getDictionaryInformation($child, $translations);
                }
            }
        }
    }