<prompt> Translate the following text to SwahiliThe colonial war in Morocco provided an almost welcome distraction, but a disastrous defeat there in 1921 led to a coup in which the general Primo de Rivera became dictator.  <response>: Vita vya ukoloni nchini Morocco vilikuwa ni kivutio cha kufurahisha, lakini kushindwa huko mwaka wa 1921 kulisababisha mapinduzi ambayo yalimfanya Jenerali Primo de Rivera kuwa dikteta. 