Skip to content

Support RTL usernames in comment header#12188

Merged
Profpatsch merged 1 commit intoTeamNewPipe:devfrom
VougJo23:commentsfix
May 7, 2025
Merged

Support RTL usernames in comment header#12188
Profpatsch merged 1 commit intoTeamNewPipe:devfrom
VougJo23:commentsfix

Conversation

@VougJo23
Copy link
Contributor

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Wrapped uploader's username using BidiFormatter to fix direction issues when combining RTL usernames with timestamps in comment headers.

Before/After Screenshots/Screen Record

  • Before:
    image

  • After:
    image

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions bot added the size/medium PRs with less than 250 changed lines label Apr 17, 2025
@ShareASmile ShareASmile added bug Issue is related to a bug GUI Issue is related to the graphical user interface comments Anything to do with comments and comment replies under videos/audios labels Apr 17, 2025
@Profpatsch
Copy link
Contributor

Example Video: https://www.youtube.com/watch?v=_t69RAfpAGY

@Profpatsch
Copy link
Contributor

We should make sure the @ stays in front of the username, right now it’s pushed all the way to the right.

@github-actions github-actions bot added size/small PRs with less than 50 changed lines and removed size/medium PRs with less than 250 changed lines labels May 7, 2025
@Profpatsch
Copy link
Contributor

I removed the formatting changes from the commit, since they obscured the logic too much.

@Profpatsch
Copy link
Contributor

I switched the code around a little, now it looks reasonable to me:

image

The `@` gets added by the youtube API and thus is a fixed member of
the username, so we do some simple detection logic to handle that
case (otherwise the `@` will be at the right side of a RTL username,
which is different of how Youtube displays these usernames in the
browser).

Fixes TeamNewPipe#12141
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 7, 2025

@Profpatsch
Copy link
Contributor

Thank you! Great change

@Profpatsch Profpatsch merged commit 862a8e8 into TeamNewPipe:dev May 7, 2025
7 checks passed
@AudricV AudricV changed the title fix: support RTL usernames in comment header Support RTL usernames in comment header May 7, 2025
@VougJo23
Copy link
Contributor Author

VougJo23 commented May 7, 2025

I kept the "@" on the right side because that's how RTL languages are read—it felt odd to start with "@" and then jump to the end of the username. I followed how YouTube does it too ( {rtl_username}@ ).
Really appreciate you taking the time to fix things in the code and approve the PR. Hope my contribution was helpful!

@Profpatsch
Copy link
Contributor

Profpatsch commented May 7, 2025

@VougJo23 Oh, wait, maybe I didn’t understand it then

For me the Youtube browser app displays it like this:
image

Maybe where the @ is put depends on your locale in general??

(edit: also sorry if I accidentally screenshot a racist comment or something, I don’t speak Arabic obviously :P)
(edit2: then what is the giant Translate To English button for you dummy …)

@Profpatsch
Copy link
Contributor

Sorry btw for taking a potentially disturbing video of a current conflict as an example :(
Next time I’ll try to find something more neutral.

Profpatsch added a commit to Profpatsch/NewPipe that referenced this pull request May 7, 2025
From the discussion in
TeamNewPipe#12188 it reads more
natural for RTL readers.
Stypox added a commit that referenced this pull request May 8, 2025
Had to make some adjustments to make #12188 work
@Stypox Stypox mentioned this pull request Jul 17, 2025
11 tasks
whistlingwoods pushed a commit to whistlingwoods/FoxPipe that referenced this pull request Jul 27, 2025
fix: support RTL usernames in comment header
whistlingwoods pushed a commit to whistlingwoods/FoxPipe that referenced this pull request Aug 25, 2025
From the discussion in
TeamNewPipe#12188 it reads more
natural for RTL readers.
whistlingwoods pushed a commit to whistlingwoods/FoxPipe that referenced this pull request Oct 6, 2025
fix: support RTL usernames in comment header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue is related to a bug comments Anything to do with comments and comment replies under videos/audios GUI Issue is related to the graphical user interface size/small PRs with less than 50 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usernames in RTL languages mess up the layout in comments

3 participants