ufirstgroup / laravel-lang-import-export

A Laravel package providing artisan commands to import and export language files from and to CSV
MIT License
41 stars 39 forks source link

error: Array to string conversion #14

Closed danielzzz closed 3 years ago

danielzzz commented 3 years ago

hi, I am getting an error where there is a nested array in the file, like fields in the following example:

this is my translation file lang/ca/models/companies.php

<?php

return [
    'singular' => 'Empresa',
    'plural'   => 'Empresas',
    'fields'   => [
        'id'              => 'Id',
        'name'            => 'Nom',
        'contact_person'  => 'Persona De Contacte',
        'dni'             => 'Dni',
        'fiscal_name'     => 'Nom Fiscal',
        'address'         => 'Direcció',
        'cp'              => 'Codi Postal',
        'region_id'       => 'Regió',
        'city'            => 'Població',
        'phone'           => 'Telèfon',
        'cif'             => 'CIF',
        'iae_id'          => 'IAE',
        'iban'            => 'IBAN',
        'created_at'      => 'Created At',
        'updated_at'      => 'Updated At',
        'company_type_id' => "Tipus d'empresa",
    ],
];

this is the command I'm using

php artisan lang-export:csv -l ca 

cheers, dan

paulkirow commented 3 years ago

Checkout https://github.com/ufirstgroup/laravel-lang-import-export/pull/15, I believe your issue is due to companies.php being nested inside /models/.

lenssoft commented 3 years ago

@danielzzz please check if dev-master fixes your issue If yes, then I'll create a new version tag for it.