Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization folders error [Laravel 5.5] #118

Open
vvatitv opened this issue Oct 24, 2017 · 7 comments
Open

Localization folders error [Laravel 5.5] #118

vvatitv opened this issue Oct 24, 2017 · 7 comments
Labels

Comments

@vvatitv
Copy link

vvatitv commented Oct 24, 2017

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

@rmariuzzo
Copy link
Owner

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

@rmariuzzo rmariuzzo added the bug label Nov 18, 2017
@vvatitv
Copy link
Author

vvatitv commented Nov 18, 2017

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

@rmariuzzo
Copy link
Owner

rmariuzzo commented Nov 19, 2017 via email

@vvatitv
Copy link
Author

vvatitv commented Nov 19, 2017

Hello, no, i'm use gulp ;)

84a50dfb0901013f8318358b2b243734

f9092ccd4444e61c962a3acd3c19f36f

@rmariuzzo
Copy link
Owner

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

@ivolkoff
Copy link

@vvatitv you can try this

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

or

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

for me it work

@vvatitv
Copy link
Author

vvatitv commented Jan 25, 2018

@ivolkoff
@rmariuzzo

Yes, it works now! Thanks great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants