How do I translate to en-BR?

Asked

Viewed 558 times

1

I have a form with following code:

{{ Form::selectMonth('month') }}

this returns me the months in English, how do I translate his return to Portuguese?

  • I’ve never used Laravel, but maybe this will work: http://answall.com/a/37911/3635

  • I have this.... these translations are for system msg... does not solve here no... but vlw by attention

  • Have you ever thought of making one <select> manually, using an array for example?

  • 1

    Try to use App::setLocale('pt'). Some information here.

1 answer

-1

Try to do manually:

{{ Form::selectMonth('month') }}

Produce your options:

<select name="month">
  <option value="1">Janeiro</option>
  <option value="2">fevereiro</option>
...
</select>

Another example:

{{ Form::selectMonth('month', 7, ['class' => 'field']) }}

<select class="field" name="month">
  <option value="1">Janeiro</option>
  <option value="2">fevereiro</option>
  <option value="3">Março</option>
  <option value="4">Abril</option>
  <option value="5">Maio</option>
  <option value="6">Junho</option>
  <option value="7" selected="selected">Julho</option>

</select>

Source

  • I don’t know where to select my way and call with {{ form:selectMonth('Month') }}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.