Knowledge Base

How to set proper text direction for right-to-left languages

Problem:

By default, each newly created signature supports left-to-right text direction. You would like to be able to use it with right-to-left languages like Arabic or Hebrew instead.

Solution:

If you want to ensure proper text direction (right-to-left) in your signature, you will have to modify its HTML code a little bit. Here’s how to do it:

  1. Go to the signature management app and choose the signature which you want to modify.
  2. Open the signature for editing by going to the Design tab and clicking Edit signature.
  3. Once the editor opens, click the HTML source button on the ribbon (Fig. 1.).

Accessing signature’s source HTML code view.
Fig. 1. Accessing signature’s source HTML code view.

  1. In the HTML source code view window, locate your text in Arabic, Hebrew, etc. It will be preceded by an opening tag (for example <p>, <td> or <span>) and followed by a closing tag (for example </p>, </td> or </span>).

    Info

    The HTML language, which is used to create email signatures, is based on tag pairs. Almost every element that is displayed in your signature resides in a container which begins with an opening tag and ends with a closing tag (same as the opening tag but with the '/' slash sign).

  2. Now, add dir=”rtl” to the opening tag of your misaligned text, as shown in Fig. 2. It needs to be placed before the end of the opening tag (>).

In this example, you need to add dir=”rtl” to the opening <span> tag.
Fig. 2. In this example, you need to add dir=”rtl” to the opening <span> tag.

  1. If your signature contains more texts in Arabic, Hebrew, etc., repeat steps 4-5 for all of them. If placeholders like {Title} are going to be replaced with a text in a right-to-left language, you will need to add dir=”rtl” to each placeholder’s opening tag as well.
  2. Once you’ve finished, click Apply & Close to close the HTML source code view window.
  3. Finally, close the editor by clicking Apply & Close and save your rule in the signature management app. 

Now, your text(s) in Arabic, Hebrew, etc. should no longer be misaligned, but should run in the correct right-to-left direction.

Was this information useful?