<prompt> Translate the following text to EnglishKatika mkataba wa Nanking 1842, China ililazimika kufungua bandari zake tano kwa uvamizi wa kigeni wa kiuchumi na kisiasa, na hata kulipia wafanyabiashara wa opiamu kwa hasara zao.  <response>: In the Treaty of Nanking 1842 China was compelled to open five of its ports to foreign economic and political penetration, and even to compensate the opium smugglers for their losses. 