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

Show user courses for sensei_user_courses shortcode in different languages #7583

Merged
merged 96 commits into from Apr 10, 2024

Conversation

merkushin
Copy link
Member

Resolves #7492 (review)

Proposed Changes

  • Show user courses for sensei_user_courses shortcode in different languages.

Known Issues

  • This PR doesn't affect Course List block. Can't find a solution for it at the moment.
  • Now we actually enrol a user into each translated course. The drawback of this solution is that the user is not automatically enrolled in a new translation. Could be addressed later as part of translation creation. (If it is okay, I'll create a separate issue.)

Testing Instructions

  1. On the My Courses page replace Course List block with the [sensei_user_courses] shortcode.
  2. Translate My Courses page.
  3. Follow our instructions to create one or more courses and their translations.
  4. Go to the frontend of the original language and take one or more courses.
  5. Switch to another language on the frontend.
  6. Check that on My Courses page you see all the courses you took and their current (shared) status. (Notice: you won't see a course if it doesn't have a translation.)

New/Updated Hooks

  • sensei_learner_enrolled_courses_query_by_progress_status_course_ids - Filters the course IDs for a learner's enrolled courses query by progress status.
  • sensei_settings_my_course_page_id - Filters the My Courses page ID.

Removed Hooks (Not released yet)

  • sensei_course_manual_enrolment_enroll_learner_course_id
  • sensei_course_manual_enrolment_withdraw_learner_course_id

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Legacy courses (course without blocks) are tested
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@merkushin merkushin added Hooks This change adds or modifies one or more hooks. WPML Compatibility issues with WPML labels Apr 7, 2024
@merkushin merkushin added this to the 4.23.1 milestone Apr 7, 2024
@merkushin merkushin requested a review from a team April 7, 2024 21:31
@merkushin merkushin self-assigned this Apr 7, 2024
Copy link

github-actions bot commented Apr 7, 2024

Test the previous changes of this PR with WordPress Playground.

@merkushin merkushin marked this pull request as ready for review April 7, 2024 21:59
Copy link

github-actions bot commented Apr 7, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link

github-actions bot commented Apr 8, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link
Contributor

@Imran92 Imran92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I am seeing translated Courses in My Courses page when I switch language! 🙌 But After I completed a translated Course, I didn't see it in the completed list

Screen.Recording.2024-04-09.at.3.11.24.AM.mov

@merkushin
Copy link
Member Author

Thanks @Imran92.

Fixed it here: c0a5fc9

While preparing the PR, moved the filter to a later point and checked only Active tab. Sorry.

Copy link

github-actions bot commented Apr 9, 2024

Test the previous changes of this PR with WordPress Playground.

Imran92
Imran92 previously approved these changes Apr 9, 2024
Copy link
Contributor

@Imran92 Imran92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

Base automatically changed from fix/wpml-translate-slugs to trunk April 9, 2024 23:42
@merkushin merkushin dismissed Imran92’s stale review April 9, 2024 23:42

The base branch was changed.

Copy link

github-actions bot commented Apr 9, 2024

Test the previous changes of this PR with WordPress Playground.

Copy link

github-actions bot commented Apr 9, 2024

Test the previous changes of this PR with WordPress Playground.

@merkushin merkushin merged commit cd49e3a into trunk Apr 10, 2024
23 checks passed
@merkushin merkushin deleted the fix/wpml-my-courses branch April 10, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hooks This change adds or modifies one or more hooks. WPML Compatibility issues with WPML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants