I think we have found a solution for you. Have a look at An introduction to KDE/fa. We added a <div dir="rtl"> tag at the beginning of the second translation unit and </div> at the end of the last unit.
One thing to note: Most pages have a translatable page title in the first unit. There are still some older pages, that do not (yet) have this. With those pages, the beginning tag should be in the first unit. I hope it will be clear from context, when the first unit is a page title (page titles are never surrounded by =-signs).
Btw. the tags look different in the editor (at least in my browser). I guess you are used to such things, but in case this is not normal behaviour but a quirk of our wiki software, I found it easiest to copy the tag from somewhere else and paste it in.
it's good but I haven't permit to add this code to any page.
You add this the same way you write your translations. Above the language bar is a link: translated version (if you have set the language to farsi, this link will also be translated). Click the link to get to the Translate page, then click the relevant unit and add the text.