Fix easily fixable plural strings

Bug #1513309 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Aaron Wells

Bug Description

When you make permission changes to a page, there's a confirmation message afterwards that tells you how many pages were changed. Apparently it was never made into a proper plural lang string, so it says e.g. "Access rules were updated for 2 page(s)".

To replicate:

1. Create a page
2. Change the permissions on the page
3. Save the changed permissions

Expected result: When you save the permissions, you should see the message "Access rules were updated for 1 page."
Actual result: When you save the permissions, you see "Access rules were updated for 1 page(s)."

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Actually, by searching for (s) I can see several old strings in the lang files, that it would be easy to pluralize. I'll see if I can tackle all of them.

Changed in mahara:
milestone: none → 16.04.0
assignee: nobody → Aaron Wells (u-aaronw)
importance: Undecided → Low
status: New → In Progress
summary: - "Access rules were updated for X page(s)" string should be made into a
- plural string
+ Fix easily fixable plural strings
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5663

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Shouldn't be backported to 15.10 because it's low-priority and non-trivial.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

I located possible strings to change in view.php, admin.php, error.php, and group.php. I decided not to change the strings in admin.php and error.php, because those particular strings won't be shown to end users, and testing them would be burdensome (many of them are for bulk user editing operations).

Here's the list of strings I did change, and how to test them. These instructions say how to generate the message that has been pluralized. So for testing, try doing it with just one thing, and it should say for example "1 page", and then try doing it with 2 or more things, and it should say for example "2 pages".

- view.php: updatedaccessfornumviews
1. Change one page's permissions, and hit save
2. You should be taken back to the "Shared by me" page and there'll be a status message that says "Access rules were updated for 1 page"

- group.php, recommendationssent
This one's a doozy. :-P It's used by the relatively obscure group recommendations functionality.

1. Create a mahara site with multiple users
2. Create a group
3. In the group settings, enable "Recommendations" and set the group join type to "Open"
4. Log in as another user.
5. Give that user a few friends.
6. Have the user join the group (as a member, not an admin)
7. Go to the group homepage
8. Near the top of the group homepage blocks section (to the left of the user status sideblock), you should see two buttons that say "Leave this group" and "Recommend to friends"
9. Click "Recommend to friends", and you'll be on the recommendation page. From here, you can send recommend this group to one or more of your friends.
10. Choose to recommend it to one or more friends, and hit the submit button
11. You'll be taken back to the group homepage, and there'll be a pluralizable message that says "1 recommendation sent"

group.php, addedtogroupsmessage and removedfromgroupsmessage

1. Create a Mahara site with multiple users
2. Log in as admin
3. Create a group. In the group settings, set the membership type to "Controlled"
4. Create a second group, also with membership type "Controlled"
5. Go to the page "Groups -> Find friends".
6. This will list all the users in the site. Click the "Edit group memberships" link next to a user.
7. A modal will open up allowing you to add or invite the user to your groups.
8. In the "Add members" section, use the tick boxes to add the user to 1 or both of your groups, and click "Apply changes"
9. Now click "Edit group memberships" again for this user.
10. Untick the tick boxes to remove the user from the group(s) and click "Apply changes"
9. Log in as the affected user
10. Go to your notifications
11. You'll have a new message titled "Your group memberships have been changed"
12. The message text is pluralizable. If added to just one group, it should say "Admin User has added you to the group", if more than one, "Admin User has added you to the groups"
13. You'll also have a second message titled "Your group memberships have been changed" similarly telling you "Admin User has removed you from the group" or "groups".

Revision history for this message
Charlie Amoah (charlie-catalyst) wrote :

Hello Aaron Wells thank you for the explanations. After a few back and forth I can finally assure that this fix is functioning as explained above so it's a pass.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5663
Committed: https://git.mahara.org/mahara/mahara/commit/fa73315e80b796e8778746ea5a89a9006dbaea85
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit fa73315e80b796e8778746ea5a89a9006dbaea85
Author: Aaron Wells <email address hidden>
Date: Thu Nov 5 18:29:54 2015 +1300

Pluralizing some old lang strings (Bug 1513309)

behatnotneeded: Will be handled by existing test

Change-Id: I476a3cc7ff1e791bc24a60986841ad92f57d7bb6

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.