DreamBerd icon indicating copy to clipboard operation
DreamBerd copied to clipboard

better Right-To-Left script support

Open emilyyyylime opened this issue 1 year ago • 1 comments

While attempting to write a DreamBerd program I ran into an interesting conundrum. As per the official style guide, I wanted to use my local currency of NIS (₪), as a string interpolation introducer. However, I was faced with the problem of <X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​ REDACTED DUE TO RULE REGARDING REPRODUCABILITY OF ISSUES X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​X​>

A possible solution is adding better RTL support: (This example required the use of a Right-To-Left Mark to align text on the right of the row, and a Right-To-Left Override to reverse the direction of text. I suggest these characters should be ignored by the compiler)

‏‮print("שלום, {שם}₪!")

I am aware using a Right-To-Left Override seems to obscure and complicate the use of Right-To-Left DreamBerd. As there are no negatives to this solution, I trust it is the path we should follow

emilyyyylime avatar Jun 12 '23 21:06 emilyyyylime

As a follow up, should we accept the following?

‏‮tnirp("שלום, {שם}₪!")

This example still includes the Right-To-Left Override character, it simply places the Latin characters in reverse order, to undo the effect of the override. This is more readable, but of course significantly less ergonomic, I feel like this is an open question

emilyyyylime avatar Jun 12 '23 21:06 emilyyyylime

If we accept that second option, it would make sense to allow the following too

tnirp("!dlroW ,olleH")!

Magnogen avatar Jun 29 '23 20:06 Magnogen

@Magnogen Well but there isn't any RTL Override in your example, so I don't see how it would make sense to accept it. However, if it were present (even without any RTL text) I think this should be accepted

emilyyyylime avatar Jul 01 '23 18:07 emilyyyylime