Added !global to conditional statement for text direction.
Merge pull request #3467 from renekopcem/fix-variable-scope

Added !global to conditional statement for text direction.