Borrowed from Moroccan Arabic شلوح (šlūḥ), plural of شلح (šilḥ). Moroccan /u/ may have an [ø]-like quality in certain positions.
Among the French military in northern Africa (Bataillon d’Afrique), it came to mean “one who cannot speak French or even Arabic”. It was later applied to German-speakers in eastern France and then, during the Second World War, to Germans at large.