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

RTL Support Please #335

Closed
safrilth opened this issue Dec 11, 2021 · 8 comments · Fixed by #935
Closed

RTL Support Please #335

safrilth opened this issue Dec 11, 2021 · 8 comments · Fixed by #935
Labels
beta Included in beta release, https://github.com/st3v3nmw/obsidian-spaced-repetition/discussions/1011 enhancement New feature or request

Comments

@safrilth
Copy link

Is your feature request related to a problem? Please describe.
I use rtl plugin for some language written from right to left.. it works for editor and preview mode, but not flashcard mode..

Editor Mode :
editor

Preview / Reading Mode :
Reading

Flashcard Mode :
flashcard

Describe the solution you'd like
Flashcard should be display something like Preview / Reading Mode.
the solution can be something to detect if display are using RTL or not (based on frontmatters showed in editor mode above ) :
if yes, then display flashcard with RTL mode activated

@safrilth safrilth added the enhancement New feature or request label Dec 11, 2021
@github-actions github-actions bot added the stale label Apr 9, 2023
@st3v3nmw st3v3nmw removed the stale label May 13, 2023
@danzilberdan
Copy link

Hey. This will be awesome! Cannot use the plugin for my native language right now :(
Great plugin though!
Dan.

@ronzulu
Copy link
Collaborator

ronzulu commented Jan 27, 2024

Shalom and/or salam @danzilberdan

Just to get some background, I translated a recent comment I posted using google translate:
image

However, when I pasted it into Obsidian the RTL didn't match:
image

Then when I changed the Obsidian editor setting for RTL it did display correctly:
image

Can we assume that this fix only needs to work Obsidian itself is set for RTL?

Are you using the Obsidian RTL Plugin. I note that it requires the same frontmatter as per the OP:

---
direction: rtl
---

Cheers
Ronny

@danzilberdan
Copy link

Understood. When changing Obsidian's default direction to RTL it works. But it is not useful because I type most of my notes LTR and just some in RTL. I am using Obsidian RTL Plugin and using the frontmatter as you have written.

@ronzulu
Copy link
Collaborator

ronzulu commented Jan 29, 2024

I've made a simple change (using the HTML dir="rtl" mechanism) which hopefully works.

I've changed yesterday's text to be a question (with Obsidian RTL on)::
image

And Obsidian RTL off:
image

The flashcard (I think) displays correctly with this test code (Obsidian RTL off):
image

Note that I haven't installed the Obsidian RTL Plugin

Testing

Could you please try out this test version of plug-in.
main_335A.zip

You will need to copy that to the obsidian plug-in folder, e.g.
D:\Obsidian\Obsidian\.obsidian\plugins\obsidian-spaced-repetition

Then reload the plug-in, or restart obsidian.

Note that the display of flashcards is currently hard coded for RTL (i.e. doesn't check the direction frontmatter)

@danzilberdan
Copy link

Perfect! And event better if it would parse the frontmatter. Amazing!

@ronzulu
Copy link
Collaborator

ronzulu commented Feb 2, 2024

Great that it worked. I've now added the frontmatter check so hopefully this is complete now.
main_335B.zip

I've also updated the flashcard "quick edit" modal to also honor the frontmatter direction setting, so if you could please verify that that works as well.

image

image

If all ok, then I'll create the PR so that it can be merged into the next mainstream release.

Cheers
Ronny

@ronzulu
Copy link
Collaborator

ronzulu commented Feb 8, 2024

Hi @issam-seghir

I've noticed that you contributed the Arabic translation to this plug-in and thought you might be interested in the requested RTL functionality that I've implemented.

It's in beta testing at the moment, and was wondering if you would be able to test as well. The latest code is the B version in my previous post above.

This new feature is probably only relevant if you have both LTR and RTL flashcards within the one vault, and use the direction frontmatter attribute, as per the Obsidian RTL Plugin.

Any feedback appreciated.

Cheers
Ronny

ronzulu added a commit to ronzulu/obsidian-spaced-repetition that referenced this issue Jul 1, 2024
@ronzulu ronzulu added the beta Included in beta release, https://github.com/st3v3nmw/obsidian-spaced-repetition/discussions/1011 label Jul 3, 2024
@ronzulu
Copy link
Collaborator

ronzulu commented Aug 10, 2024

This has been released into the latest mainstream release 1.12.5

@ronzulu ronzulu closed this as completed Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Included in beta release, https://github.com/st3v3nmw/obsidian-spaced-repetition/discussions/1011 enhancement New feature or request
Projects
None yet
4 participants