Translation-invariant generalized $P$-adic Gibbs measures for the Ising model on Cayley trees