Skip to content

Commit 42a52b7

Browse files
authored
Merge pull request #12259 from Profpatsch/put-@-on-right-side-of-rtl-usernames
Comments: Put @ on the right side of right-to-left usernames
2 parents d9dccfa + e554c77 commit 42a52b7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

app/src/main/java/org/schabi/newpipe/util/Localization.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,14 @@ public static String concatenateStrings(final String delimiter, final List<Strin
9090
* Localize a user name like <code>@foobar</code>.
9191
*
9292
* Will correctly handle right-to-left usernames by using a {@link BidiFormatter}.
93+
* For right-to-left usernames, it will put the @ on the right side to read more naturally.
9394
*
9495
* @param plainName username, with an optional leading <code>@</code>
9596
* @return a usernames that can include RTL-characters
9697
*/
9798
@NonNull
9899
public static String localizeUserName(final String plainName) {
99-
final BidiFormatter bidi = BidiFormatter.getInstance();
100-
101-
if (plainName.startsWith("@")) {
102-
return "@" + bidi.unicodeWrap(plainName.substring(1));
103-
} else {
104-
return bidi.unicodeWrap(plainName);
105-
}
100+
return BidiFormatter.getInstance().unicodeWrap(plainName);
106101
}
107102

108103
public static org.schabi.newpipe.extractor.localization.Localization getPreferredLocalization(

0 commit comments

Comments
 (0)