rmariuzzo / Laravel-JS-Localization

🌐 Convert your Laravel messages and consume them in the front-end!

Home Page:https://github.com/rmariuzzo/laravel-js-localization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Localization folders error [Laravel 5.5]

vvatitv opened this issue · comments

Hello,
Sorry for my english, but i have a bug with your generated js.

The problem is that if you have custom folders in your lang folder, this package is not work.

Folder: resources/lang/XX/

Image laravel
I have the folder "page" or others.

When i'm generate .JS file, i'm get variables this type:

ru.page.privacy:
  ----
     ---

Image var

which corresponds to the file: resources/lang/ru/page/privacy.php
Image phpvar

But, it's not work, when i call function

Lang.get('page.privacy.site.title');

Image function

I have idea, but it's not best, but it's works for me.
We need change the file function "getMessages()":

in /src/Mariuzzo/LaravelJsLocalization/Generators/LangJsGenerator.php

and replace 128-130 line in file to:
Image changefile

We get the variables:

ru.page_privacy:
  ----
     ---

Image newvar

And now, your package will be work.
image good

Can you use the last version 1.4.5 and see if it is fixed?

Hello,
Current version 1.4.6 - not work...
Version 1.4.5 - not work...

Hello, no, i'm use gulp ;)

84a50dfb0901013f8318358b2b243734

f9092ccd4444e61c962a3acd3c19f36f

Ok, I did a tool for webpack. Will take a look at that issue. Also, will check for a gulp plugin that does this.

@vvatitv you can try this

Lang.get('page/privacy/site.title');

or

Lang.get('page/privacy.site.title');

for me it work

@ivolkoff
@rmariuzzo

Yes, it works now! Thanks great.