[ResourceBundle] Fix sorting links generation

Fixes #1917.