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

Wrong locale loaded for translations #35

Open
shadowinek opened this issue Apr 20, 2018 · 3 comments
Open

Wrong locale loaded for translations #35

shadowinek opened this issue Apr 20, 2018 · 3 comments

Comments

@shadowinek
Copy link

shadowinek commented Apr 20, 2018

Hi,

I am trying to use your package, but I have issues with translation. Our locale settings looks like this:

'locale' => 'de',
'fallback_locale' => 'en',

In the application the user can select de or en as his language. With de everything is ok. But when the user uses en the translations look like this: The password muss sowohl groß- als auch kleingeschriebene Buchstaben enthalten.

The issue is, that the translations are loaded before the user is even initialized and the package is loading the translations with the default locale.

Did you encounter similar issues?

Thanks.

edit: We are using Laravel 5.5.40 with auto-discovery

@notlose
Copy link

notlose commented Apr 17, 2019

i have the same issue with my application, @shadowinek did you found a workaround?

@Nekroido
Copy link

Nekroido commented Nov 6, 2020

I guess the package's folder structure should follow this format:

schuppo
- password-strength
- - src
- - - lang
- - - PasswordStrength.php
- - - ...

And then get initialized with $this->package('schuppo/password-strength', 'password-strength', __DIR__);.
Can't think of a workaround except just gutting everything out into a custom service provider.

@avramovic
Copy link

I had the same issue, but instead of butchering the package I just copied the functionality and translations for the languages I'm using, and it works like a charm. Here's the solution in a gist. It uses same validation rule names (and translation keys) so it's basically a drop-in replacement for this package.

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

No branches or pull requests

4 participants