Laravel, confide translations / new names – confide::confide

So, imagine that we are using Laravel and creating a new form…

 <div class="form-group">
 <label for="nif">{{{ Lang::get('confide::confide.nif') }}}</label>
 <input class="form-control" placeholder="{{{ Lang::get('confide::confide.nif') }}}" type="text"
 name="nif" id="nif" value="{{{ Input::old('nif') }}}">
 </div>

We will see returned confide::confide.nif and not anything else…
How do we solve this?

Inside /app/lang/pt/ (pt is my default language… you should use yours…….) create the following file: confide.php and with a structure like the other files (duplicate,rename and change it) inside that folder create the new entries…

<?php
return array(
 /*
 |--------------------------------------------------------------------------
 | Confide Language Lines
 |--------------------------------------------------------------------------
 |
 | The following language lines contain the default error messages used by
 | the validator class. Some of these rules have multiple versions such
 | such as the size rules. Feel free to tweak each of these messages.
 |
 */
 "nome_completo" => "Nome completo",
 "morada" => "Morada",
 
 "nif" => "NIF",
 "email_confirmacao" => "Email Confirmação",

We now, have to CALL confide.nif and not confide::confide.nif.

Read more at
http://stackoverflow.com/questions/19338437/override-package-localization-in-laravel
https://github.com/laravel/framework/issues/2467#issuecomment-26211312
http://laravel.com/docs/localization#language-files

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*