potsky / laravel-localization-helpers

🎌 Artisan commands to generate and update lang files automatically
GNU General Public License v3.0
187 stars 39 forks source link

Dynamic fields with parameters In language lines #55

Open PRodO5lNk5 opened 7 years ago

PRodO5lNk5 commented 7 years ago

Maybe this is more of a question, somewhat referencing issue #53 I am still getting the same error when running localization:missing command but on a different line

My directive is this:

@lang('pages/master/home.offers.message.' . session("message"), ['membership' => url('membership')])

And my translation file looks like this:

'offers' => array(
         'message' => array(
           'login'  => 'You need to login first.',
           'premium' => 'You need to change your membership to premium. If you want to know more, click <a class="btn-link" target="_blank" href=":membership">here</a> to find out.',
           'card'     => 'You can use your member card for this offer.'
         )
    ), 

Then I added message to the never_obsolete_keys array

'never_obsolete_keys' => array(
    'dynamic',
    'fields',
        'message',
    ) ,

And the error_log gives this output:

'pages/master/home.offers.dynamic.message.' . session("message"), ['membership' => url('membership'
PHP ParseError:  syntax error, unexpected ',', expecting ';' in /var/www/html/local.familiando/vendor/potsky/laravel-localization-helpers/src/Potsky/LaravelLocalizationHelpers/Factory/Localization.php(559) : eval()'d code on line 1