-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Feature Request: i18n prefix_except_default
strategy
#158
Comments
So, I'm seeing two topics here. You have an issue with duplicate forward slashes. For the So the EN pattern would be Does that work for you? |
@boazpoolman thx for answering, so...
Well, it is still to come to this (if the option to make locale empty by default is developed), because by default locale cannot be `` empty. By the way, this is an idea.
Yes I thought about that, but when ~20 languages is it worth it to manually do it for each one separately? if there was an exception option. |
About the double slashes; I'm still not quite sure how this is happening. About this issue (#158), in the case of 20 languages you could just make one generic URL pattern, and create a single one for a specific language. That second pattern will then override the generic one. |
No concerns about the double slashes; originally, I anticipated a potential issue down the road, especially if there were plans to develop an empty default language. However, the code already addresses this scenario. To streamline, might want to contemplate incorporating a boolean setting such as "replace default language with empty value." |
I'll take that in consideration! |
ok, and I'll try this, as it looks like a potentially working workaround |
Great! I'll close this issue then. |
Implement strategy like prefix_except_default
is default language
en
for/[locale]/blog/[id]
:expected:
/en/blog/123
->/blog/123
/es/blog/123
->/es/blog/123
also problem with whitespace prefixes (
//blog/123
):Conditional string
(maybe need integrate engine like handlebars/ejs end etc..) - https://handlebarsjs.com/guide/block-helpers.html#conditionals/[locale ? locale + '/' : '' ]
.replace('//', '/')
The text was updated successfully, but these errors were encountered: