Dozens of prominent activists in Hong Kong have been sentenced to up to 10 years in jail, sparking criticism from foreign governments and rights groups.