I would like to know how I can concatenate laravel php function lang with javascript variable. Here an example:
This code not work. The variable text is on javascript an is dynamic. The php function lang does not translate the concatenated word, display reportParameter.txt_date
Not work display reportParameter.txt_date
template: `
<div class="text-center mt-1">
<div class="custom-control custom-radio custom-control-inline" v-for="(text, val, index) in optionsParsed">
<input class="custom-control-input" type="radio" v-model="checked" :id="nomRadio+'_'+index" :name="nomRadio" :value="val" @change="getChecked(checked)">
<label class="custom-control-label" :for="nomRadio+'_'+index">@lang('reportParameter.'.@{{text}}')</label>
</div>
</div>
`
it works display Date
template: `
<div class="text-center mt-1">
<div class="custom-control custom-radio custom-control-inline" v-for="(text, val, index) in optionsParsed">
<input class="custom-control-input" type="radio" v-model="checked" :id="nomRadio+'_'+index" :name="nomRadio" :value="val" @change="getChecked(checked)">
<label class="custom-control-label" :for="nomRadio+'_'+index">@lang('reportParameter.text_date')</label>
</div>
</div>`
The problem is the variable text must be generated dynamically. The problem is only how I do the concatenation. I don't concatenate there correctly. I try a lot of different ways, but no success.
Thank you so much for your help.