src/CoreBundle/EventListener/DcGeneral/EnvironmentPopulator/TranslatorPopulator.php
private function mapTranslations($array, $domain, StaticTranslator $translator, $baseKey = '')
    {
        foreach ($array as $key => $value) {
            $newKey = ($baseKey ? $baseKey . '.' : '') . $key;
            if (is_array($value)) {
                $this->mapTranslations($value, $domain, $translator, $newKey);
            } else {
                $translator->setValue($newKey, $value, $domain);
            }
        }
    }
private function mapTranslations($array, $domain, StaticTranslator $translator, $baseKey = '')
    {
        foreach ($array as $key => $value) {
            $newKey = ($baseKey ? $baseKey . '.' : '') . $key;
            if (is_array($value)) {
                $this->mapTranslations($value, $domain, $translator, $newKey);
            } else {
                $translator->setValue($newKey, $value, $domain);
            }
        }
    }
Map all translation values from the given array to the given destination domain using the optional base key.

@param array            $array      The array holding the translation values.
@param string           $domain     The target domain.
@param StaticTranslator $translator The translator.
@param string           $baseKey    The base key to prepend the values of the array with.

@return void