I am trying to create a template for algorithms in Persian. I have a piece of code given on this stack exchange post, where I am using algpseudocode along with algorithm package. This setup works nicely; however, I would also like to have indentation lines in my algorithms so I tried to use algpseudocodex with noEnd option, which has this feature. Although, this nicely works for algorithms in English, it is totally messed up in Persian. How can I fix this?