Move lang and dir into translateFragment
Make ctx.et return an empty string on errors