XWIKI-4923: PrettyNames of class properties are not being translated in the object editor
- Also done minor formatting to improve the readability of the code