According to the discuss of bug 882592, I think it is more accurate to do these in the localized handler. When localized is fired before calling ready, the callback of ready will be called once immediately[1]. In this case, the lang and dir will not be initialized when user changes the language in settings app. So, I will move them to a localized handler.

[1] https://github.com/mozilla-b2g/gaia/blob/0505d8adb0a76556584e302cd524c0bed41445f9/shared/js/l10n.js#L1223