XWIKI-9616: $doc is wrong when a sheet is applied to a document translation
* Check if the document on which #setAsContextDoc is called is a translation and set the $doc and $tdoc Velocity variables accordingly.