Category : translation

I work with Laravels (v 6.2) Eventserviceprovider where i registered my Queuable Emails as in following Example: <?php namespace AppMail; use AppModelsCompany; use IlluminateBusQueueable; use IlluminateContractsQueueShouldQueue; use IlluminateQueueSerializesModels; class CompanyFormationRequestCompletedInfoMail extends LoggedMailable implements ShouldQueue { use Queueable; use SerializesModels; public Company $company; /** * Create a new message instance. * * @param Company $company */ ..

Read more

i would like to change the language of the messages if the password does not match the rules. I use the following code to check a password: ‘password’ => [‘required’, ‘confirmed’, Password::min(12) ->mixedCase() ->letters() ->numbers() ->symbols() ->uncompromised() ], If the password does not match the rules, I get an error message, but in English. I ..

Read more

I have been trying to figure out how one could manage translations between local and staging enviroments with laravel and the translation package https://github.com/barryvdh/laravel-translation-manager. I would like to give my client the possibility to do the translations himself. He is not a programmer so forget asking him to pull/push files though git. He would only ..

Read more

I Installed fresh Laravel (v-7) and also install joedixon/laravel-translation package, all are working fine. After that I have changed root directory and others like – Moved index.php into root directory, ex: myproject/public/index.php to myproject/index.php Move .htaccess into root directory In index.php, changed- require __ DIR __.’/vendor/autoload.php’; and $app = require_once __ DIR __.’/bootstrap/app.php’; And added ..

Read more

I Installed fresh Laravel (v-7) and also install joedixon/laravel-translation package, all are working fine. After that I have changed root directory and others like – Moved index.php into root directory, ex: myproject/public/index.php to myproject/index.php Move .htaccess into root directory In index.php, changed- require __ DIR __.’/vendor/autoload.php’; and $app = require_once __ DIR __.’/bootstrap/app.php’; And added ..

Read more

Guys in my laravel application my primary language is French. In my sign in blade as for the email address field, I’ve used the following input field, <input id="email" type="email" class="form-control @error(’email’) is-invalid @enderror txt_forms" name="email" value="{{ old(’email’) }}" placeholder="{{ __(‘texts.email’) }}" autocomplete="email" autofocus title="Format d’email invalide"> Now the issue is that whenever I tried ..

Read more

I’m trying to display a translated word on the blade in a laravel application. my language variable is "texts" and I have the following on my blade @foreach($permission as $value) <li><label>{{ Form::checkbox(‘permission[]’, $value->id, false, array(‘class’ => ‘name’)) }} {{ (‘$value->name’) }}</label></li> <br/> @endforeach I’m trying to translate this {{ (‘$value->name’) }} This should give a ..

Read more

I’ve got a few blades and I have included there many appeals like this: <div>{{ __(‘auth.Example’) }}</div> <a href=’#’>{{ __(‘xyz.Another One Example’) }}</a> <span>{{ __(‘xyz.Example Number Three’) }}</span> … I added xyz.php and auth.php files to lang/en and lang/pl directories. Now I’m wondering, is it possible to use some command or method, which will add ..

Read more

In my laravel application, I have a user registration form. Since the application is a multilingual one, I’m trying to translate each and every single text, including the placeholder texts. {!! Form::text(‘first_name’, null, array(‘placeholder’ => ”.{{ __(‘texts.First Name’) }}.”,’class’ => ‘form-control txt_txt’)) !!} {!! $errors->first(‘first_name’, ‘<span class="help-block" role="alert">:message</span>’) !!} When I try to run this, ..

Read more

I came across an issue while trying to implement a translation system in a Laravel project. In the layout file, layout.php, I set the language before yielding the contents: <?php App::setLocale(session()->get(‘language’)); ?> And it seems to be working for the @lang instructions that follow (placed inside layout.php). After those, I yield the content of the ..

Read more

I’m using microsoft azure translate but the result is not same as i expected, for example EN text : Superior Double Room with Private Bathroom with Hair Dryer, Flat-screen TV, Telephone, Tea / Coffee Maker, Facility, Ironing Facilities Comfortable Bed Expectation : Superior-dobbeltværelse med privat badeværelse med hårtørrer, fladskærms-tv, telefon, te- og kaffefaciliteter, facilitet, strygeudstyr ..

Read more

Goal Load translations from multiple files in different directories. Description Inside the ServiceProvider of my laravel package i can load all translations from one directory like this and it works: public function boot() { $this->loadTranslationsFrom(__DIR__ . ‘/../resources/lang’, ‘package-namespace’); } The structure of the package is: – config – database – resources – assets – lang ..

Read more

Laravel is not changing the language I have tried these methods in controller if ($request->lang === ‘English’) { config([‘app.locale’ => ‘en’]); } else { config([‘app.locale’ => ‘ar’]); } and this method App::setLocale(‘ar’) Or this method App::setLocale(‘ar’) What should I do? Sourc..

Read more

I’m working on a multi-language website where the URL’s contain localized strings. For instance: https://site/en/members/john-doe https://site/nl/leden/john-doe (and so for every language) In web.php I prefixed my routes. Via middleware I set the current language (retrieved from the first url-segment). This works fine for everything (both in controllers and in blade)… except for the urls generated ..

Read more