added more consistent way to determine ltr/rtl