Skip to content

Commit d1303dd

Browse files
Profpatschwhistlingwoods
authored andcommitted
Comments: Put @ on the right side of right-to-left usernames
From the discussion in TeamNewPipe#12188 it reads more natural for RTL readers.
1 parent 7a8f8fb commit d1303dd

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,14 @@ public static String concatenateStrings(final String delimiter, final List<Strin
8585
* Localize a user name like <code>@foobar</code>.
8686
*
8787
* Will correctly handle right-to-left usernames by using a {@link BidiFormatter}.
88+
* For right-to-left usernames, it will put the @ on the right side to read more naturally.
8889
*
8990
* @param plainName username, with an optional leading <code>@</code>
9091
* @return a usernames that can include RTL-characters
9192
*/
9293
@NonNull
9394
public static String localizeUserName(final String plainName) {
94-
final BidiFormatter bidi = BidiFormatter.getInstance();
95-
96-
if (plainName.startsWith("@")) {
97-
return "@" + bidi.unicodeWrap(plainName.substring(1));
98-
} else {
99-
return bidi.unicodeWrap(plainName);
100-
}
95+
return BidiFormatter.getInstance().unicodeWrap(plainName);
10196
}
10297

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

0 commit comments

Comments
 (0)