ardi gunawan
ardi gunawan

Reputation: 425

localization image laravel 5

what code should I write for localization in laravel 5 for an image?

The following code I used to string

ENGLISH lang

       <?php
   return [
      'namaSaya' => 'MY NAME',
      'registrasi' => ' REGISTRASION'      
   ];

INDONESIA lang

       <?php 
return [
      'namaSaya' => 'NAMA SAYA',
      'registrasi' => ' REGISTRASI'      
   ];

and the code that I use to display

{{ trans('content.namaSaya') }}

any idea?

Upvotes: 2

Views: 1263

Answers (1)

Filip Koblański
Filip Koblański

Reputation: 10008

Try just like this:

<?php 
return [
  'namaSaya' => 'NAMA SAYA',
  'registrasi' => ' REGISTRASI',
  'sampleImg' => url('to/img_in_certain_lang.jpg')
];

and then just:

<img src="@lang('content.sampleImg')" />

Upvotes: 2

Related Questions