I'm having problems with the encoding of some localized strings in laravel.
In my localization file for Spanish I have (among many other strings):
"truck" => "camión"
In myView.blade.php, if I print the string directly:
<h2>{{trans('localizationFile.truck'}}</h2>
It works fine and prints
camión
But if I try to use that same string in javascript:
<script>
$(document).ready(function()
{
alert("{{trans('events.camion')}}");
}
</script>
It codifies the accented o and the alert reads: camión
How can I fix that? Or am I doing something wrong? Perhaps that's not the way to localize javascript messages...
Thanks in advance!