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
1
vote
0 answers

Problem using codezero-be / laravel-localized-routes and livewire

Ive problems using livewire. All works fine, but when I type the input, data refresh and dissapear data from views/livewire/filtro. When I click on url, data comes well. Ive to refresh url to view data. Ive tried displya blade without Front…
1
vote
2 answers

Pluralization is not working when using translation strings as keys in laravel localization

I added this in fr.json { "There is one apple|There are many apples": "Hay una manzana|Hay muchas manzanas" } In blade file: {{__("There is one apple")}} Then it shows There is one apple It should show Hay una manzana. Please help me to solve…
abhishekvbajaj
  • 73
  • 1
  • 10
1
vote
1 answer

how to set the locale prefix in hreflang tag in Laravel Localization

I'm working on an international website with 3 languages (Eng - FR and AR) based on laravel localization. And I want to set the locale prefix in hreflang tag. My site is structured like this: http://example.com/{locale}
1
vote
1 answer

Laravel trans_choice not working after PHP 8.0 upgrade

I have the following assertion in a feature test: // just a convenience method to post a CSV file $this->importData($postdata, $csv) ->assertStatus(200) ->assertExactJson([ "alert" => null, // response text copied from…
miken32
  • 42,008
  • 16
  • 111
  • 154
1
vote
1 answer

Laravel - How to set lang dynamically for API?

I have an endpoint to switch the lang: {{base_url}}/localize/{lang} So, The controller class LocalizationController { if (!is_null($lang) && !empty($lang)) { App::setLocale(request('lang')); } } But, It seem not working with API. I…
Sok Chanty
  • 1,678
  • 2
  • 12
  • 22
1
vote
3 answers

laravel localization using mcamara package giving 404 error on root url but not other urls

i am trying to use mcamara package for language translation but on the root url i am getting 404 error. Actually i am trying to detect the ip address of the user and then set the locale according to that country. i stored the locales and country…
Naveed Ali
  • 1,043
  • 7
  • 15
1
vote
1 answer

laravel localization using mcamara package

i am trying to use laravel mcamara package for automatic language translation from the language files. the package supposed to be working in this way: when i access the website for example from France and i configured french language in the package…
Naveed Ali
  • 1,043
  • 7
  • 15
1
vote
1 answer

Consider locale (separators) for laravel validator numeric rule

I use the localization feature of laravel for the localization of my application. When I set the locale to german (de) (using App::setLocale()) and use the validator rule 'amount' => ['required', 'numeric', 'min:0'], I get an validation error when…
1
vote
1 answer

Laravel - translate password reset email - email.blade.php

The following code appear in the email.blade.php: @lang( "If you’re having trouble clicking the \":actionText\" button, copy and paste the URL below\n". 'into your web browser: [:actionURL](:actionURL)', [ 'actionText' =>…
user979719
  • 43
  • 1
  • 7
1
vote
0 answers

laravel not setting session data from first time

Alright so I got this locale system with a middleware, the issue is that when I enter language "hu"it doesnt set it the first time, it usualy works only the 2nd time I do it... web.php Route::get('set_language/{locale}', function ($locale) { …
Tomislav Tomi Nikolic
  • 608
  • 3
  • 10
  • 15
1
vote
1 answer

How do I force laravel to use the en.json file on my translation folder?

I am trying to implement multi language support on laravel. I have other language like korean and spanish inside ko.jso and es.json files. BUt the problem is if I include en.json. It won't be detected by laravel. It uses the default string found in…
Yves Gonzaga
  • 135
  • 1
  • 3
  • 16
1
vote
2 answers

Laravel - Use language permanently after login

I have an application in laravel and now I need to put this in several languages. In user table I add a column lang that tells me the default language for each user. So after login I create a session variable to store this value: protected function…
user3242861
  • 1,839
  • 12
  • 48
  • 93
1
vote
2 answers

The numbers get reversed when use of arabic language

I am using laravel localization Here is the code I am using

@lang('frontend/watch-detail.Reference.retail') @if($watch['price'] == 0 || $watch['price'] == NULL) N/A @else @php …

1
vote
1 answer

How to Set Default language in laravel

I'm using laravel locale, How to set default language. my app.php, that is not working. 'locale' => 'my', 'timezone' => 'Asia/Rangoon', 'fallback_locale' => 'my',
soe-moe
  • 41
  • 1
  • 7
1
vote
0 answers

same slug for multiple language website in Laravel 5.5

My laravel 5.5 project has 2 language (en and fr). for each article, I write twice,one for fr,one for en each article has an unique slug (but same slug for other language). for eaxample: example.com/fr/articleslug example.com/en/articleslug I try…
Ali
  • 1,127
  • 1
  • 10
  • 23