Compensation for all deputy, chief deputy, part-time deputy, assistant, and part-time assistant district attorneys shall be fixed by the district attorney with the approval of the board of county commissioners or boards of county commissioners of multicounty districts or the city council of a city and county affected, and each county comprising such judicial district shall pay such deputies, chief deputies, assistants, and part-time assistants salaries in the proportion which the population of such county bears to the whole population of such judicial district.