Two-dimensional non-abelian bosonization in the presence of external gauge fields and gravity