CommunityCommons.SubstituteTemplate use getCaption on enumeration

If I am correct substituteTemplate currently uses the stringvalue of an enumeration to replace {enum}. How can I change the code to use the caption (getCaption)?
2 answers

Untested, but if you add the following lines to javasource/communitycommons/ in function 'getValueOfPath' after the second if statement (line 166), you will probably experience the desired behavior:

        else if (member instanceof MendixEnum) {
            MendixEnum m = (MendixEnum) member;
            String value = m.getValue(context);
            if (value == null || value.isEmpty())
                return "";
            return Core.getInternationalizedString(context, m.getEnumeration().getEnumValues().get(value).getI18NCaptionKey());

I believe that in java an enumeration has the function getCaption which would return the caption of the value :] Then again, what does the function Substitute template do? Because i am not really sure if you really want to make any changes in the code of the community commons itself.