RTL language with Sublime Text editor
Asked Answered
T

6

29

The RTL languages are not supported in the sublime text editor

I tried this plug-in Bidirectional text support on windows os

  • Copied all files from the zip Sublime-Text-2-BIDI-master to the ST3 folder and changed the font type and size.

  • then I copied the unicodedata.pyd to C:\Users\USERNAME\AppData\Roaming\Sublime Text 2\Packages\Bidirectional text support\bidi now the Tools > Bidirectional text part didn't look gray anymore but it is still disabled.

  • also I copied these two lines but it didn't work

sys.platform.startswith('win'):
sys.path.append('../../..')

Any help would be appreciated

Turpentine answered 1/9, 2014 at 10:12 Comment(0)
D
12

In order to get Sublime Text to work with Arabic characters using Sublime Text BIDI plugin on Windows correctly, ensure you've done the following:

  1. Copy the plugin folder to the following path C:\Users\USERNAME\AppData\Roaming\Sublime Text 2\Packages\

  2. Copy unicodedata.pyd from ST installation directory to both, the main plugin folder which in your case is Sublime-Text-2-BIDI-master and inside bidi folder.

  3. Set your sublime user-settings to the following:

    { "font-face": "arial", "font_size": 11, "default_encoding": "UTF-8", "fallback_encoding": "Arabic (Windows 1256)" }

  4. Reload the plugin by viewing rtl.py and saving

In the case that doesn't fix it, you can read what sublime console log outputs when you click on Bidirectional text for a given Arabic text, console log can be accessed through ctrl+~.

Delaware answered 13/11, 2015 at 2:30 Comment(1)
Noting that it supports Sublime Text 3 as well (even if the name is "Sublime-Text-2-BIDI")Pencel
G
7

Very Easy,

Just follow this Video steps دعم اللغة العربية في برنامج Sublime

1- Download the Sublime-BIDI-master folder from Github of solution

2- Extract it and paste under \Sublime Text Build (whatever)\Data\Packages(the downloaded folder).

3- open sublime wit any RTL Language file and right click anywhere you'll new options (Bidirectional text) .. Click it :).

Grapevine answered 9/5, 2017 at 8:41 Comment(0)
L
3

However, in my Sublime version (build 3126), Arabic letters will be reshaped when switching to Bidi.

Initially in the range U+0621-U+064A, which are the usual Unicode codes for Arabic letters, characters will be mapped to the range U+FE70-U+FEFC, which are codes for each (isolated, initial, middle, final) Arabic connected forms. These latter codes, called Arabic-Presentation-Forms-B, are deprecated by Unicode and their usage should be very limited.

For example, before switching to Bidi, the word كتب, looks ب ت ك, from left to right U+0643 U+062A U+0628. This is the memory order. (It is up to the final rendering tool to display the string in visual order by connecting letters.)

After Bidi switching in Sublime, the word will appear good as كتب, because the codes are ﺐ ‎U+FE90 followed by ﺘ U+‎FE98 followed by ﻛ U+‎FEDB. In this order. That means, in a Bidi enabled tool like a browser, it will appear ﺐﺘﻛ as the final visual order. This is not what the user expects.

So, not only Bidi switching changes the letters code, it also changes the memory order.

Leu answered 16/6, 2017 at 12:49 Comment(1)
Rather a thing to know for people who use Arabic script (RTL) and want to switch to Bidi in SublimeText.Leu
L
1

Personal experience.

When editing a source file (HTML and other languages or formats) containing some RTL characters, it is really tricky to navigate in the text edited. So the mode "before" (logical or memory order) might be very helpful than the mode "after" (visual or display order). With logical order, it's useless to join letters, it doesn't make sens.

Leu answered 3/2, 2017 at 11:17 Comment(0)
S
0

Check this link, I had the same problem but solved it with the Sublime Text BIDI plugin.

Demo of the plugin

Scarf answered 13/2, 2015 at 6:27 Comment(1)
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.Psychosomatic
B
0

I was still facing an issue because of the editor's font. It will be recommended to use a fixed-width font like Courier New. This should ensure the plug-in works as expected.

Blowzed answered 7/12, 2019 at 0:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.