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

Get localized string on the fly

I am trying to run a seeder for getting a string in different locale (I stored the lang file in lang/es.json). (For being able to search in both english and spanish, I needed to store both values in database). Now, I'm trying to run it inside my…
senty
  • 12,385
  • 28
  • 130
  • 260
0
votes
3 answers

Translate Laravel Spark plan features

I was wondering what would be the best way to display my Spark plan features in multiple different languages. Let's say I have the followings features Spark::plan('Premium', 'monthly-artist-premium') ->price(10) ->trialDays(14) …
Sam Bellerose
  • 1,782
  • 2
  • 18
  • 43
0
votes
2 answers

Laravel localization multiline

I have a question. I want to localize a multi line text in laravel, in file content.php from /lang/en. The proble is that if i break the text in lines(so that my code looks more readable) i get error 419. My code would look like this:
Sami
  • 141
  • 2
  • 10
0
votes
0 answers

Laravel 5.6. Form validation in the custom package

I'm making custom package and have problems with localized validation attribute output. How can I fix this problem? It returns post_localizations.en.post_title instead of localized string Post title (EN) I have input in my form:
Andrii
  • 324
  • 3
  • 16
0
votes
2 answers

Laravel setLocale returns stored value but use config.app default one

I am getting some strange problem... as title said... I am making post request to change lang value by setting lang forever cookie. After that I am checking if cookie exist and if it does to app()->setLocale(\Cookie::get('lang')) and then use {{…
user8517929
0
votes
1 answer

Laravel Mcamara\LaravelLocalization giving error when used in package

I just installed Mcamara\LaravelLocalization following the documentation but I get an error Call to undefined method Mcamara\LaravelLocalization\Facades\LaravelLocalization::setLocale() The error comes from the web.php routes file of my package. If…
0
votes
1 answer

How to get localization array values from sub folder?

I have sample file structure in my app: Folders: lang->en->admin Here I have sample localization file: menu.php Code in file: 'Admin Dashboard', ]; How I can get home key value in blade? I now tested this example code…
Andreas Hunter
  • 4,504
  • 11
  • 65
  • 125
0
votes
3 answers

Laravel get getCurrentLocale() in AppServiceProvider

I'm trying to get the LaravelLocalization::getCurrentLocale() in the boot() method of the Laravel AppServiceProvider class, and although my default locale is pt I always get the en. The package I'm using is mcamara/laravel-localization. Code I…
McRui
  • 1,879
  • 3
  • 20
  • 31
0
votes
0 answers

get routes in especial language in laravel5

I have 2 languages in my laravel. for example, when I print route('home'); in France page, it prints: http://127.0.0.1/8000/fr and in english: http://127.0.0.1/8000/en How can I print http://127.0.0.1/8000/en in France page? (each page of my site…
Ali
  • 1,127
  • 1
  • 10
  • 23
0
votes
2 answers

How to translate webpage data to other language?

I am using laravel 5.2.i want to convert our data to Hindi. I have one table with 60 columns and that data is saved in english but I want to convert in to Hindi. I have read the localization tutorial but there is no proper explanation can anyone…
user7925057
0
votes
0 answers

how to get laravel single locale string in blade template?

This is my message.php file which in my locale file.Code are given bellow. return [ 'title' => 'This is Bangla Page', ]; Now i want to retrieve my string 'This is Bangla Page' . How to do that. I use blade templating and write…
0
votes
1 answer

laravel localization ignore language on one page

Using mcamara laravel localization , for one specific page I need to ignore the language identifier. Our project URLs are all in the form of www.project.com/en|fr/page , for one page only we need to have the URL as www.project.com/example I tried a…
user1661286
  • 133
  • 1
  • 3
  • 12
0
votes
1 answer

Laravel localization file format error: array() versus [] format

I am struggling a bit with localization in Laravel 5.3 (with php 7). The default localizaiton file format in Laravel 5.3 is using brackets, as in this example: return [ 'footer.contact.email' => 'Email:', ] That's what I have been using in my app…
0
votes
0 answers

mcamara/laravel-localization is changing my assets (css, js, others) route

I'm using mcamara/laravel-localization on my project everything is working perfectly, but when I'm trying to a layout (ressources/views/layouts) to include all my pages the localization is also affecting my assets, the css ans js files are not…
don_jon
  • 113
  • 3
  • 11
0
votes
1 answer

Translatable not insert when saving

I have a weir issue with translatable. I have two main model used translatable, the first one work perfectly. The second dont work anymore. I spent 2 days for rewrite, compare between 2 models but nothing happends. Here is my code class Page extends…
trinvh
  • 1,500
  • 2
  • 11
  • 20