src/Property/ParsableValueTrait.php
protected function pairTranslatableArrayItems($value, $separator = ',')
    {
        if (empty($value) && !is_numeric($value)) {
            return null;
        }

        if ($value instanceof Translation) {
            $value = $value->data();
        }

        if ($separator instanceof \Closure) {
            $value = $separator($value);
        } else {
            // Parse each locale's collection into an array
            foreach ($value as $k => $v) {
                $value[$k] = $this->parseAsMultiple($v, $separator);
            }
        }

        // Retrieve the highest collection count among the locales
        $count = max(array_map('count', $value));

        // Pair the items across locales
        $result = [];
        for ($i = 0; $i < $count; $i++) {
            $entry = [];

            foreach ($value as $lang => $arr) {
                if (isset($arr[$i])) {
                    $entry[$lang] = $arr[$i];
                }
            }

            $result[] = $this->translator()->translation($entry);
        }

        return $result;
    }
protected function pairTranslatableArrayItems($value, $separator = ',')
    {
        if (empty($value) && !is_numeric($value)) {
            return null;
        }

        if ($value instanceof Translation) {
            $value = $value->data();
        }

        if ($separator instanceof \Closure) {
            $value = $separator($value);
        } else {
            // Parse each locale's collection into an array
            foreach ($value as $k => $v) {
                $value[$k] = $this->parseAsMultiple($v, $separator);
            }
        }

        // Retrieve the highest collection count among the locales
        $count = max(array_map('count', $value));

        // Pair the items across locales
        $result = [];
        for ($i = 0; $i < $count; $i++) {
            $entry = [];

            foreach ($value as $lang => $arr) {
                if (isset($arr[$i])) {
                    $entry[$lang] = $arr[$i];
                }
            }

            $result[] = $this->translator()->translation($entry);
        }

        return $result;
    }
protected function pairTranslatableArrayItems ( $ value , $ separator = ',' ) { if ( empty ( $ value ) && ! is_numeric ( $ value ) ) { return null ; } if ( $ value instanceof Translation ) { $ value = $ value -> data ( ) ; } if ( $ separator instanceof \ Closure ) { $ value = $ separator ( $ value ) ; } else { // Parse each locale's collection into an array foreach ( $ value as $ k => $ v ) { $ value [ $ k ] = $ this -> parseAsMultiple ( $ v , $ separator ) ; } } // Retrieve the highest collection count among the locales $ count = max ( array_map ( 'count' , $ value ) ) ; // Pair the items across locales $ result = [ ] ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ entry = [ ] ; foreach ( $ value as $ lang => $ arr ) { if ( isset ( $ arr [ $ i ] ) ) { $ entry [ $ lang ] = $ arr [ $ i ] ; } } $ result [ ] = $ this -> translator ( ) -> translation ( $ entry ) ; } return $ result ; }
Pair the translatable array items.

Converts this:
```
{
"en": [ "Item A", "Item B", "Item C", "Item D" ],
"fr": [ "Élément A", "Élément B", "Élément C" ]
}
```

Into:
```
[
{
"en": "Item A",
"fr": "Élément A",
},
{
"en": "Item B",
"fr": "Élément B",
},
{
"en": "Item C",
"fr": "Élément C",
},
{
"en": "Item D",
"fr": "",
}
],
```

@param  mixed $value     The value being converted to an array.
@param  mixed $separator The item delimiter. This can be a string or a function.
@return array
Pair the translatable array items .