We introduce a generalized nonuniform mean-field formalism to describe the dissociation of weak rodlike polyelectrolytes (PEs). Our approach allows for two-sublattice symmetry breaking which in titration curves is associated with a plateau for intermediate dissociation degrees. We first test our method in the case of a single weak PE by comparison with exact enumeration studies and show that it gives quantitatively accurate results for the dissociation degree in the full range of pH values and specifically performs much better than the nearest-neighbor approximation (where exact solutions are possible). We then study charge regulation of the coupled system of a weak polyacid and a weak polybase as a function of their mutual distance, which has some relevance for PE multilayer formation and for PE complexation. An intricate interplay of the degree of dissociation and the effective interaction between the PEs as a function of their mutual distance is found.