You mistake about this attribute (lang) in inputText component.
<f:loadBundle basename="resources.ApplicationMessages" var="bundle"/>
<h:inputText id="test-input" dir="#{bundle.dir}" required="false" />
you could use dir for right-to-left and left-to-right direction and for your language you should use javascript or ajax to convert keyworks to farsi not lang tag in component.