Questions tagged [laravel-localization]

Laravel's localization features provide a convenient way to retrieve strings in various languages, allowing you to easily support multiple languages within your application.

Laravel's localization features provide a convenient way to retrieve strings in various languages, allowing you to easily support multiple languages within your application.

For more information about Laravel's localization functionality, see the official docs.

113 questions
77
votes
3 answers

How can I use HTML tags in a Laravel localization file?

I'm trying to utilize Laravel's localization feature, but I need to be able to put emphasis or bolden a portion of a phrase. Inserting a HTML tag into the language file causes it to be escaped when outputted to a blade. For example, here is my…
Michael Irigoyen
  • 22,513
  • 17
  • 89
  • 131
8
votes
3 answers

Where to add parameter to Route: verification.notice {language}/email/verify

Missing required parameters for [Route: verification.notice] [URI: {language}/email/verify] I added the laravel email verification to my project, after using localization. But now I have the problem that the Route: verification.notice is missing a…
7
votes
2 answers

How to do unit testing with Laravel Localization?

I'm using mcamara/laravel-localization package and I can't figure out how to make it work with my unit tests. Both of the following fail with red: // 1. This one results in "Redirecting to http://myapp.dev/en" $this->get('/')->assertSee('My App…
Alex
  • 3,719
  • 7
  • 35
  • 57
6
votes
2 answers

Laravel class translator does not exist in a configuration file

Is there any way that allows inserting translatable value in configuration file in laravel-5.4 application? I have a custom configuration file at config/fox-reports.php and I'm trying to set a translatable configuration value looks like the…
SaidbakR
  • 13,303
  • 20
  • 101
  • 195
5
votes
4 answers

Laravel localization and routes from Jetstream / Fortify

I have this new Laravel project to work on. We would like to make it available in multiple languages. I started the project with JetStream. Routes for authentication and such are automatically handled by JetStream / Fortify. I then added…
5
votes
2 answers

Laravel - How to Clear cache of array language

I have a laravel application and I have two different languages. My problem is that I'm using queued emails and that just work with default language, so I try to add new keys and values to default language array to give me the possibility to use in…
user3242861
  • 1,839
  • 12
  • 48
  • 93
5
votes
1 answer

Generate lang files dynamically

I have a situation that I had to sync my array with language files, so every time I had to generate & translate it. I was looking for a package like laravel-langman it has an option to sync. But now that I am looking, it doesn't allow me to create…
Payam Khaninejad
  • 7,692
  • 6
  • 45
  • 55
5
votes
3 answers

Validation localization with arrays of input in laravel 5?

for a dynamic form in which fields can be added and modified: in form . . . in controller for…
5
votes
1 answer

Which are good strategies for organizing localization files for trans() in Laravel 5.x?

This is a question about methodology and suggested practices. I know it is not strictly attached to the framework and not even PHP, and the answer might be "its up to you". But my concern is about best practices and methodology, as there usually…
alariva
  • 2,051
  • 1
  • 22
  • 37
4
votes
1 answer

Validating Password rules with a custom error message

Using standard notation like "password.required" I can customize an error message for built-in validation rules. But how can I customize error messages for Illuminate\Validation\Rules\Password rules? $rules = [ 'password' => [ …
4
votes
1 answer

How to use strtolower in *.blade.php file with @lang extension in Laravel?

I have tried this, but get error: {{ strtolower( @lang('basics.days') ) }} How can I transform to lowercase my localized string in a .blade.php file in Laravel 5.4?
netdjw
  • 5,419
  • 21
  • 88
  • 162
3
votes
1 answer

How to set current language in Laravel notification

I want to translate the notification email when a user is registering but it's always the default language that is sent. I have CustomEmailVerificationNotification class that is overwriting the default vendor /…
3
votes
2 answers

Which syntax to use to translate in Blade files?

I am using Laravel 8 and I want to translate a website. As I have a lot of translations to do, I will use the "translations strings as key" (please see Laravel documentation). I can use the following two methods in my Blade files. {{ __('A propos')…
Dom
  • 2,984
  • 3
  • 34
  • 64
3
votes
1 answer

Laravel localization, how to get custom language value

I have az/app.php, en/app.php and ru/app.php language files in resources/lang directory, let's say app language is en right know, but I wanna get az language value without changing app language. trans('app.Fransa') works with current app language…
Ozal Zarbaliyev
  • 566
  • 6
  • 22
1
2 3 4 5 6 7 8