Support for Group Routes and "espanol" as locale
abdulwahid opened this issue · 2 comments
I have two questions.
- Does this provide support for grouped routes?
- Is there a way to have
espanol
as locale insteades
E.g I want to have following routes:
EN Routes:
/blog/abc
/blog/mno
/blog/xyz
ESPANOL Routes:
espanol/blog/abc
espanol/blog/mno
espanol/blog/xyz
For using espanol
, i can do it by using espanol
instead of es
altogether throughout the project but this make me use espanol
as locale key instead of es
.
I can add locales
in config/app.php
'locales' => ['en' => 'English', 'espanol' => 'Espanol']
So instead of
resource/lang/es
I would need to do like this:
resource/lang/espanol
What i want is to have some mapper for using es
as locale key instead of espanol
.
@chinleung Any help will be much appreciated.
Does this provide support for grouped routes?
I'm not sure to understand this question. It is possible to achieve the three routes in your example with the locale key at the moment. So it would be:
es/blog/abc
es/blog/mno
es/blog/xyz
Otherwise the locale key would have to be espanol
.
Is there a way to have espanol as locale instead es
Yes like you mentioned, you can do:
'locales' => [
'en' => 'English',
'espanol' => 'Espanol',
],
Could you explain what's the use case of having both mixed? Like why you want es
as locale key, but use espanol
at other places?
It would be possible to add a config for mapping the route prefixes of the locale, but I'm just trying to understand the utility first.
It was just the requirement to have espanol
in routes, i just wanted to use es
as locale key internally to follow conventions. However i have fixed the issue by using espanol
as locale key.