Generate namespaced routes correctly for generators. Fix for #11532