@if(is_array($value))
    <tr>
        <td @if(is_array($value))colspan="2"@endif>
            <h4>{{ $key }}</h4>
        </td>
    </tr>

    @foreach($value as $subKey => $subValue)
        @include('translation.translation_row', [
            'language' => $language,
            'key' => $subKey,
            'value' => $subValue,
            'parent' => isset($parent) && $parent ? "{$parent}[$key]" : $key,
            'prefix' =>  "{$prefix}.{$key}",
            'langsource' => $langsource,
            'show' => $show,

        ])
    @endforeach
@else

    <?php
    $bool = Lang::has($prefix.'.'.$key, $language, false);
    ?>
    <tr <?php if($show == 'empty' && $bool) echo 'style="display:none"'; ?>>
        <td>{{ $key }}</td>
        <!--<td>{!! nl2br(htmlentities($value)) !!}</td> -->
        <td>
            <?php
            $old = $key;
            $name = $key;
            if (isset($parent) && $parent)
            {
                $name = "{$parent}[{$key}]";
                $old = preg_replace('/\[([^\]])\]/', ".$1", "{$parent}[{$key}]");
            }
            ?>

            <textarea name="{{ $name }}"
                      class="form-control @if(!$bool) has-error @endif"
                      rows="4">{{ old(
                  "{$old}",
                  $bool ? Lang::trans($prefix.'.'.$key, [], $language) : null
              ) }}</textarea>
        </td>
    </tr>
@endif
