private static function createPlainRepresentationByArray(
        array &$translations,
        string $language,
        array $data,
        array $structure,
        string $prefix
    ) {
        foreach ($data as $key => $value) {
            $currentStructure = $structure;
            if (is_array($value)) {
                $emptyArray = [];
                self::appendValueIntoStructure(
                    $currentStructure,
                    $key,
                    $emptyArray
                );
                self::createPlainRepresentationByArray(
                    $translations,
                    $language,
                    $value,
                    $currentStructure,
                    $prefix . '.' . $key
                );
            } else {
                $builtKey = trim($prefix . '.' . $key, '.');
                $translation = Translation::create(
                    $builtKey,
                    $value,
                    $language
                );

                self::appendValueIntoStructure(
                    $currentStructure,
                    $key,
                    $value
                );
                $translation->setStructure($currentStructure);
                $translations[] = $translation;
            }
        }
    }
private static function createPlainRepresentationByArray(
        array &$translations,
        string $language,
        array $data,
        array $structure,
        string $prefix
    ) {
        foreach ($data as $key => $value) {
            $currentStructure = $structure;
            if (is_array($value)) {
                $emptyArray = [];
                self::appendValueIntoStructure(
                    $currentStructure,
                    $key,
                    $emptyArray
                );
                self::createPlainRepresentationByArray(
                    $translations,
                    $language,
                    $value,
                    $currentStructure,
                    $prefix . '.' . $key
                );
            } else {
                $builtKey = trim($prefix . '.' . $key, '.');
                $translation = Translation::create(
                    $builtKey,
                    $value,
                    $language
                );

                self::appendValueIntoStructure(
                    $currentStructure,
                    $key,
                    $value
                );
                $translation->setStructure($currentStructure);
                $translations[] = $translation;
            }
        }
    }
private static function createPlainRepresentationByArray ( array & $ translations , string $ language , array $ data , array $ structure , string $ prefix ) { foreach ( $ data as $ key => $ value ) { $ currentStructure = $ structure ; if ( is_array ( $ value ) ) { $ emptyArray = [ ] ; self :: appendValueIntoStructure ( $ currentStructure , $ key , $ emptyArray ) ; self :: createPlainRepresentationByArray ( $ translations , $ language , $ value , $ currentStructure , $ prefix . '.' . $ key ) ; } else { $ builtKey = trim ( $ prefix . '.' . $ key , '.' ) ; $ translation = Translation :: create ( $ builtKey , $ value , $ language ) ; self :: appendValueIntoStructure ( $ currentStructure , $ key , $ value ) ; $ translation -> setStructure ( $ currentStructure ) ; $ translations [ ] = $ translation ; } } }
Given an array, return a list of plain keys and values.

@param array  $translations
@param string $language
@param array  $data
@param array  $structure
@param string $prefix
Given an array return a list of plain keys and values .