Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#5855 closed defect (bug) (fixed)

RTL support for @atme mention auto-suggestions

Reported by: netweb's profile netweb Owned by: djpaul's profile djpaul
Milestone: 2.1 Priority: normal
Severity: normal Version:
Component: Toolbar & Notifications Keywords:
Cc:

Description

Just been testing this using the RTL plugin, see video here: https://cloudup.com/czr5BXG8sU3

Related: #3278 I was going to reopen that ticket but I think this may involve more than a quick fix

In the video the two usernames referenced are:

  • Username: hardy.oconner Name: Hardy O'Conner
  • Username: loren.pacocha Name: Loren Pacocha
  • In LTR mode typing @hard @atme pops up @hardy-oconner Hardy O'Conner
  • In RTL mode typing @hard does not popup any username
  • In LTR mode typing @ha @atme pops up @hardy-oconner Hardy O'Conner
  • In RTL mode typing @hard @atme pops up @loren.pacocha Loren Pacocha

To be honest I do not know if this is idiosyncratic behaviour in the way the RTL Tester plugin works or not.

I expected that by typing either @ha or @hard in LTR or RTL for the @atme to pop up Hardy O'conner's name.

Any native RTL users able to test this @mention functionality?

Note: Usernames with a period are converted to a hypen e.g. hardy.oconner to hardy-oconner and work as expected

Change History (8)

This ticket was mentioned in IRC in #buddypress-dev by netweb. View the logs.


10 years ago

#2 follow-up: @DJPaul
10 years ago

  • Milestone changed from Awaiting Review to 2.1

Thank you for testing this. I knew there were RTL issues in the @mentions changes prior to beta 1 but I also wanted to use it to see how many testers we have that use RTL; unfortunately, very few, it seems.

It looks like @yoavf has worked on the RTL Tester plugin, I'm happy to assume that it works correctly.

When I tested this previously, I noticed bad CSS issues, but I think I know why it might not be finding the same user results. In https://buddypress.trac.wordpress.org/browser/trunk/src/bp-core/bp-core-classes.php#L2672 I made the assumption that a username in RTL would effectively be "reversed" in the database compared to what we expect in a LTR language (e..g. stored as "lauP" instead of "Paul"), so the search_wildcard position is flipped around.

I guess I should have done research to check if that quick assumption was accurate or not; let's find a RTL user and ask them. :) It is easy to change if the assumption was faulty, though the CSS fixes will require much more effort.

#3 in reply to: ↑ 2 @netweb
10 years ago

Replying to DJPaul:

When I tested this previously, I noticed bad CSS issues, but I think I know why it might not be finding the same user results. In https://buddypress.trac.wordpress.org/browser/trunk/src/bp-core/bp-core-classes.php#L2672 I made the assumption that a username in RTL would effectively be "reversed" in the database compared to what we expect in a LTR language (e..g. stored as "lauP" instead of "Paul"), so the search_wildcard position is flipped around.

I was making all kinds of 'guesses' as to how all the logic in this works also, I'm quite sure mine is entirely flawed :P

Here goes, it is RTL, which relates to reading and writing, or display in our case, but the order is still the same for this use case, If I want to mention Paul, I type P, a, u, l, and I do exactly the same for lauP, P is the first letter reading from right to left, a is the second, u the third and lastly l.

I guess I should have done research to check if that quick assumption was accurate or not; let's find a RTL user and ask them. :) It is easy to change if the assumption was faulty, though the CSS fixes will require much more effort.

Indeed, this is really the only way to know for certain ;)

#4 @djpaul
10 years ago

In 9008:

Activity: @mentions RTL fixes

The suggestions window was being stretched full width, due to the mentions.js only setting .left (after left had been set in the CSS), but in RTL, right had been set, causing a full-width window.

See #3278, #5855

#5 @DJPaul
10 years ago

I have tested word/letter order in the database in RTL (in a variety of languages). Letter order (at least, latin letters) is not changed.

A sentence in a RTL language will have the word order reversed, obviously -- because it's RTL not LTR. :)

#6 @djpaul
10 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 9009:

Activity: @mentions Fix search logic for RTL.

I'd previously made a faulty assumption regarding letter order in the database, but my testing reveals the letter order stays intact, it is the word order that is reversed. Pending feedback from anyone who uses a RTL language, I'm modifying the search logic so that it's identical in both LTR and RTL modes.

Fixes #5855

#7 @DJPaul
10 years ago

This is good enough for 2.1 now, as far as I can tell. I'd rather we wait for bug reports from people who use a RTL language who can advise us the correct behaviour, if anything else is odd. We can fix in a 2.1 point release or 2.2 as necessary.

#8 @netweb
10 years ago

Sounds good, I will be interested to find out how close the methodology I/we used here was, I hope it wasn't to far off :)

Note: See TracTickets for help on using tickets.