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
0
votes
1 answer

Laravel Translation Still `en` even if locale changed

i'm trying to change language with laravel but it still en (fallback_locale) locale changes successfully to another language but laravel still depends on fallback_locale while changing fallback locale to 'ar' as example, blade prints the key as…
0
votes
1 answer

How to retrieve localization string from nested array in Laravel 8

I started to prepare localization strings for my application based on Laravel 8.19, and I found that nested arrays are not working. I copied auth.php from \resources\lang\en to \resources\lang\ru and added few strings in nested array 'login' =>…
schel4ok
  • 634
  • 1
  • 11
  • 33
0
votes
3 answers

How to retrieve translation strings inside a php code in laravel blade template

I am trying to use the localization retrieval of string inside of php foreach loop code in blade template in laravel 8. Inside the foreach loop, I am trying to manipulate a value called $item['label'] and equate translate the value of it using the…
Karl
  • 37
  • 5
0
votes
1 answer

How to get Carbon localized date with locale digits in Laravel?

With Laravel using Carbon for dates. Carbon has localization support. I have been using $date->locale($locale)->isoFormat('LL'). Example, for Chinese, $date->locale('zh-CN')->isoFormat('L') to get localized data. It returns 1992年9月11日. Is there any…
Shafi
  • 1,850
  • 3
  • 22
  • 44
0
votes
2 answers

problem in changing default language (localization) in laravel 7

iam trying to make multilanguage view in laravel i set up everything but when i change the localization in config/app.php from "en" to "ar" ... it stays "en" and i tested with the function App::getLocal my files of translation "messages.php" for…
mehdi
  • 1
  • 4
0
votes
1 answer

Laravel Localization add class active if open this Local

I'm trying to do what language is included in it added class"active" I try this way but it doesn't work for me
    @foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties) …
Arthur
  • 385
  • 3
  • 13
0
votes
1 answer

laravel 5.8 language localization not working in my project

i made this localization before in another project , but this project i changed in admin middleware to make permissions for users in dashboard. this project is for two languages arabic and english it is working fine in website out admin but in admin…
ahmed
  • 137
  • 14
0
votes
2 answers

Mcamara\LaravelLocalization\Exceptions\SupportedLocalesNotDefined error given after install

I just install 'mcamara/laravel-localization' after install follow to steps and add Route::group( [ 'prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'localeSessionRedirect', 'localizationRedirect', 'localeViewPath' ] ],…
officialmmt
  • 65
  • 1
  • 2
  • 12
0
votes
1 answer

How to use db instead of Laravel localization config file

I'm using mcamara/laravel-localization. I need to get languages from db instead of laravellocalization config file. Any ideas how to do that. I would be so grateful.
Mikayel
  • 15
  • 12
0
votes
0 answers

Comment or uncomment Laravel Localizations config file

I'm using mcamara/laravel-localization. Admin can add or delete the specific supported languages in dashboard, so I need to comment or uncomment some lines in Laravel Localizations config file from my controller. Config file screenshot down…
0
votes
1 answer

Laravel localization with url

I am developing a multi-language web app using Laravel framework. So in this app, I have a special condition to do multi-language feature as below. a user can select from some flags and change the language manually. It changes his URL to /{lang}…
Deemantha
  • 433
  • 9
  • 30
0
votes
4 answers

Laravel's localization on JavaScript Variables

I have some JavaScript variables that I output on a rating scale as shown below. I now want to achieve Laravel's localization therefore translate the variables before outputting them on the browser. How can I achieve this? I tried as below but it…
User101
  • 115
  • 1
  • 4
  • 11
0
votes
0 answers

how to access current locale inside model eloquent laravel?

I have been searching alot for this problem solution. I need to access current app locale set earlier inside my controller function using \App::setLocale('en'). But later on i was unable to get current locale inside model using app()->getLocale() or…
0
votes
0 answers

Laravel validation errors doesn't work properly - localization issue

I have several languages on my application and I'm using laravellocalization package (Here is github page) Well package works fine, I checked both of Laravellocalization::getCurrentLocale() and App::getLocale(). Both of them gave me correct locale..…
Teoman Tıngır
  • 2,766
  • 2
  • 21
  • 41
0
votes
0 answers

Laravel Localization with database: "unserialize(): Error at offset 31 of 54 bytes

I created a Survey website, and then I want to use dynamic localization, I need to store everything in two languages in the database. So if the user chose "EN" at the right top corner it should display everything in English. I used unserialize and…
Anoud0m
  • 1
  • 1