-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: add routes useSupportedLocalesOnly property #6073
feat: add routes useSupportedLocalesOnly property #6073
Conversation
Or maybe it would be easier to bind to App::$supportedLocales? |
@iRedds With this that can be done in the Routes config with |
However, the application locale depends on |
I agree. I don't know why the locale pattern needs to override |
These cases are not covered by tests. |
You are right. What I intended to do was to limit the routes to the languages defined in |
I got your idea. But for now I don't know the solution. |
If you don't want this, add option to change the behavior? E.g. $routes->useDefinedLocalesOnly(true); |
@kenjis I like that solution. It wil solve the problem. Do you think there should be a config like |
So, it seems we need to add a property and a setter method for it. The config in App is |
a7317d9
to
21ebcda
Compare
The problem that I ran into is when designing a DropDown for lanuages with the country flag the language does not match with the country code. Example: In the CI Translations the code for Japan is ja but using the Country+Region it is ja-JP or en-JPN there is also If you look at the flags-icons which are svg images they are named different Japan is jp. I think we need to change the translation files to the correct 2, 4 or 5 codes to match the language or language+region codes. Just my opinion. |
21ebcda
to
8c91c44
Compare
I think that is a diferent subject from this PR
The |
@pjsde Can you update the explanation in #6073 (comment) ? |
Co-authored-by: kenjis <[email protected]>
@kenjis done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Adds a control flag so that the
Router
only validates the locales that are defined inApp::$supportedLocales
, returning anCodeIgniter\Exceptions\PageNotFoundException::forLocaleNotSupported()
if the locale introduced is not supported.Checklist: