Derivation of a fluid-dynamical lagrangian and electric giant resonances