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

Map locales to custom slugs #20

Closed
ivanvermeyen opened this issue Jan 17, 2020 · 3 comments
Closed

Map locales to custom slugs #20

ivanvermeyen opened this issue Jan 17, 2020 · 3 comments
Labels
3.0 feature request New feature or request

Comments

@ivanvermeyen
Copy link
Contributor

Add the ability to configure custom slugs values for locales, in addition to localized domains.

Maybe something in the lines of:

'supported-locales' => ['en', 'nl'],

'domains' => [
    'en' => 'en.domain.test',
    'nl' => 'nl.domain.test',
],

'slugs' => [
    'en' => 'english',
    'nl' => 'dutch',
],

If you don't add a slug for a locale, the locale itself can be used, so it is optional.
If you don't add a domain for a locale, the default app_url be used, so it is optional.

@ivanvermeyen
Copy link
Contributor Author

Also map route name prefix to locales? See #35

@mro95
Copy link

mro95 commented Aug 18, 2021

I like the idea of slugs, any progress?

@ivanvermeyen
Copy link
Contributor Author

Not yet, as there was need for it yet.
But I can start thinking about it more seriously :)
It will take some time though, depending on the impact this has on the rest of the features.

tanerkay added a commit to tanerkay/laravel-localized-routes that referenced this issue Jan 10, 2023
tanerkay added a commit to tanerkay/laravel-localized-routes that referenced this issue Jan 10, 2023
ivanvermeyen pushed a commit that referenced this issue Jan 10, 2023
* add support for custom prefixes for localized routes (#20)
* alternatively, use the locale as the route name prefix and the custom prefix only for the URLs
* minor fix: `array_key_first()` is a PHP 7.3+ function being used in a repo with support for PHP 7.1+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants