Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hebrew language support #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kerneljake
Copy link

This pull request adds Right to Left (RTL) language support to Squeezeplay.

Previously, RTL languages like Hebrew were displayed backwards.
It would be like reading xof nworb kciuq ehT instead of The quick brown fox.
Now, an in-memory RTL string like:
ABC (DEF) GH (1234)
is displayed in a manner that makes visual sense to a native speaker:
(1234) HG (FED) CBA

image

The hebrewflip() function in LMS on the server side is designed for its display codepath (Fonts.pm and Graphics.pm), therefore we must flip the item_loop status messages locally using the FriBidi library. The two windows affected are Now Playing and Current Playlist.

Test cases:

  • play Hebrew radio streams from the LMS web interface via: Radio → By Location → Asia → Israel → All Stations
    (or individual cities like: → Tel Aviv-Yafo → All Stations). Example stations include:
    • Kan Kol Hamisca 91.3 Classical
    • Radio Tel Aviv 102.0 Top 40 & Pop Music
  • You should see the titles in Squeezeplay’s Now Playing match Material’s playlist since the latter uses hebrewflip()
  • cycle through each visualizer
  • add more tracks to the current playlist to examine the Playlist

image

Tested on macOS only:

  • 10.13.6 (x86_64)
  • 14.6.1 (M3)

The topmost makefiles for other platforms will need to have fribidi added.

Notes

  • The playback state at the top of the screen (known as the “title status” in the code) is unchanged, i.e. “Now Playing”, “Paused”, “Stopped”, etc. since those strings do not have RTL translations in strings.txt
  • There are no server-side modifications or dependencies here; any RTL language issues that exist in LMS will continue to exist.
  • I originally wanted to include both Hebrew and Arabic codepoint ranges in jive_label.c, but Arabic characters are displayed as empty rectangles in Squeezeplay. Due to time constraints, I have not dived into FreeType to understand why.

@ralph-irving
Copy link
Owner

Sorry, I haven't merged your PR yet.
It takes a lot of time to test that it doesn't break Windows and Linux builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants