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

Respect locales mapping #631

Merged
merged 4 commits into from
Jun 28, 2019
Merged

Respect locales mapping #631

merged 4 commits into from
Jun 28, 2019

Conversation

dmitrybubyakin
Copy link
Contributor

app('config')->set('laravellocalization.localesMapping', [
    'en' => 'custom',
]);

// Route::prefix(app(...)->setLocale()) => http://localhost/cusom => custom
$this->assertEquals('custom', app('laravellocalization')->setLocale('custom'));
// Current locale is en
$this->assertEquals('en', app('laravellocalization')->getCurrentLocale());

// both are in supported locales
$this->assertTrue(app('laravellocalization')->checkLocaleInSupportedLocales('en'));
$this->assertTrue(app('laravellocalization')->checkLocaleInSupportedLocales('custom'));

// use the mapping
$this->assertEquals('http://localhost/custom/some-route', app('laravellocalization')->localizeURL('some-route', 'en'));
$this->assertEquals('http://localhost/custom/some-route', app('laravellocalization')->localizeURL('some-route', 'custom'));

@mcamara
Copy link
Owner

mcamara commented May 5, 2019

Can you write this feature into the README and the CHANGELOG files?

I'll merge the PR after it, thanks a lot for your work!

@dmitrybubyakin
Copy link
Contributor Author

@mcamara Thank you for great package!

@mcamara mcamara merged commit af8f9f3 into mcamara:master Jun 28, 2019
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

Successfully merging this pull request may close these issues.

3 participants