In all prosecutions under the provisions of either section 270, section 270a, section 270b, section 271 or section 271a, of this code, where a conviction is had and sentence of imprisonment in the county jail or in the city jail is imposed, the court may direct that the person so convicted shall be compelled to work upon the public roads or highways, or any other public work, in the county or in the city where such conviction is had, during the term of such sentence. And it shall be the duty of the board of supervisors of the county where such person is imprisoned in the county jail, and of the city council of the city where such person is imprisoned in the city jail, where such conviction and sentence are had and where such work is performed by a person under sentence to the county jail or to the city jail, to allow and order the payment out of any funds available, to the wife or to the guardian, or to the custodian of a child or children, or to an organization, or to an individual, appointed by the court as trustee, at the end of each calendar month, for the support of such wife or children, a sum not to exceed two dollars for each day’s work of such person so imprisoned.
(Amended by Stats. 1927, Ch. 243.)