translation - translate page with symfony 3 -


i want translate web pages using symfony3. have dropdown list of countries , , dropdown list of language , when user select his/her country, list of languages changes (displays languages country can speak). problem here : how can affect value of selected option (which represent language , en | fr | jp | tr etc ) '_locale' ?? have tried :

var val = field.options[field.selectedindex].value;    option1.setattribute('data-href',"{{ path(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'val' })) }}"); 

the 'val' read string. want affect variable. how can please ?

ps: code not complete here because doesn't matter


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -