This sort of thing happened at least as late as 1756 when Frederick the Great conscripted defeated soldiers of Saxony to form 10 regiments under Prussian officers. However as you pointed out if they had the native lingo they had the opportunity to desert, which opportunity most of these reluctant Prussians availed themselves of.
Fighting for 'your country' is a very recent mindset. In almost any war prior to WWI you will find solders fighting for whomever they find will pay them the most or are ideological compatible with. The famous Swiss Guards and the Gurkha units of both the British and Indian armies are remnants of a time when it wasn't uncommon for soldiers to fight for someone else as regular soldiers (as defined separate from mercenaries). For several centuries the royal French Army fielded several "Irish" regiments which were consistently used against the British Army (who of course was fielding Irish regiments of their own).
The Mexicans recruited a unit of Catholics from their POWs during the Mexican War (1846-1848) to fight against the 'Protestant' US.
It also happened during WWII as the German and Japanese recruited among their POWs for units in the their armed forces. The Germans "promised" the western allied soldiers they recruited that they would only fight against the Soviets and sent the recruited Soviet soldiers to fight in the west. The Japanese recruited locals (mostly Indian and other southeast Asian POWs) to help 'liberate' their homeland.
And of course the Roman wholesale enlisted defeated 'barbarians' (the original definition of that word is people who did not speak Greek) as auxiliaries.
And to bring it back to slavery there are many examples of units that were constructed of 'slaves' to be used against the enemies of their enslavers. The most famous are probably the Ottoman Janissaries (1380ish-1826), but you also have the Mamelukes (9th Century to 1811) in Egypt and the Brazilian Empire may have used slave soldier as late a the War of the Triple Alliance (1864-1870).
Another case where you had manpower intensive situations that technology had not yet replaced.