Fix bug in translator replacements for strings that have the same beginning. Fixes #1114.
Renamed original sort to sortBy