Consider a non-linear sigma model on a Riemannian manifold with metric $g_{ij}$ with the action
$$S= \frac{1}{2} \int dt g_{ij}(X) \frac{dX^i}{dt} \frac{dX^j}{dt}.$$
The momentum operator is $$P_i= \frac{\delta S}{\delta \dot{X}}= g_{ij} \partial_t X^j,$$ and $X$ and $P$ satisfy the commutation relation $$[X^i, P_j]= i \delta^i_j.$$
Can we similar to the standard (flat) case identify $$P_i= -i \hbar D_i,$$ with $D_i$ being the covariant derivative? If yes, why is this generalization correct?