-
Notifications
You must be signed in to change notification settings - Fork 232
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
Improve Route Handling for Localized and Non-Localized Routes #1063
Conversation
✅ Deploy Preview for activist-org canceled.
|
Thank you for the pull request!The activist team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Development rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you! Maintainer checklist
|
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.
First PR Commit Check
- The commit messages for the remote branch of a new contributor should be checked to make sure their email is set up correctly so that they receive credit for their contribution
- The contributor's name and icon in remote commits should be the same as what appears in the PR
- If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for
git config user.email
in their local activist repo
Hi @Mohtelsayed 👋 FYI I'm seeing that your email isn't set up correctly for Git. Can you please check that the email you use for GitHub is the same as the response you get from |
Do you want to fix your email and then open another PR? You can also try to commit to this branch again :) |
@andrewtavis Should be set up now. Let me know if there is anything else. |
The commits here are still not for your account. Do you want to close this and open a new PR? :) Can also review this one, but as I said your account won't get the credit. |
Ok sure |
@andrewtavis How about now. I think it should be set up. If not ill just make a new one. |
I'll squash the commits and it should work now :) Thanks, @Mohtelsayed! |
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.
Thanks for the contribution here, @Mohtelsayed! This definitely cleans up the route check functionality more and integrates well with the work from your classmates 😊
This pull request addresses issue #963 .
Description:
This pull request enhances route handling to accommodate both localized and non-localized routes. The core changes include:
Key Changes:
Locale-Agnostic Route Comparison: Introduced removeLocaleFromRouteName to strip locale prefixes from route names. This allows for consistent route comparisons, regardless of the current locale.
Subpage Detection: Updated isCurrentRoutePathSubpageOf to consider locale-stripped route names. This ensures accurate subpage identification, even when switching between locales.
Route Inclusion Check: Modified currentRoutePathIncludes to utilize locale-stripped route names, improving the reliability of route inclusion checks.
Benefits:
Consistent Route Handling: Ensures that route comparisons and subpage detection work correctly across different locales.
Simplified Logic: Streamlines route handling by removing unnecessary locale-specific checks.
Improved User Experience: Provides a seamless user experience, especially when switching between languages or navigating complex route structures.
Testing:
Tested the changes in various scenarios, including:
Navigating to subpages within different locales
Checking route inclusion and subpage detection under different language settings
Please review the code changes and provide feedback.