Source:
String resolveTemplatePath(final Context context, final Writer writer, final RenderParams params, final String[] arguments) { ContentletVersionInfo cv; final String argument = arguments[0]; try { cv = APILocator.getVersionableAPI().getContentletVersionInfo(argument, params.language.getId()); if (cv == null) { long defaultLang = APILocator.getLanguageAPI().getDefaultLanguage().getId(); if (defaultLang != params.language.getId()) { cv = APILocator.getVersionableAPI().getContentletVersionInfo(argument, defaultLang); String inode = (params.mode.showLive) ? cv.getLiveInode() : cv.getWorkingInode(); Contentlet test = APILocator.getContentletAPI().find(inode, params.user, params.mode.respectAnonPerms); ContentType type = APILocator.getContentTypeAPI(APILocator.systemUser()).find(test.getContentTypeId()); if(type.baseType() == BaseContentType.CONTENT && !Config.getBooleanProperty("DEFAULT_CONTENT_TO_DEFAULT_LANGUAGE", false)){ throw new ResourceNotFoundException("cannnot find contentlet id " + argument + " lang:" + params.language); } else if(type.baseType() == BaseContentType.WIDGET && !Config.getBooleanProperty("DEFAULT_WIDGET_TO_DEFAULT_LANGUAGE", true)){ throw new ResourceNotFoundException("cannnot find widget id " + argument + " lang:" + params.language); } } } } catch (Exception e1) { throw new ResourceNotFoundException("cannnot find contentlet id " + argument + " lang:" + params.language); } boolean showWorking = false; if (context.get("_show_working_") != null && (boolean)context.get("_show_working_")) { showWorking = true; } return File.separator + ( (!showWorking) ? params.mode.name() : PageMode.PREVIEW_MODE.name() ) + File.separator + argument + "_" + cv.getLang() + "." + EXTENSION; }

Target:
String resolveTemplatePath(final Context context, final Writer writer, final RenderParams params, final String[] arguments) { ContentletVersionInfo cv; final String argument = arguments[0]; try { cv = APILocator.getVersionableAPI().getContentletVersionInfo(argument, params.language.getId()); if (cv == null) { long defaultLang = APILocator.getLanguageAPI().getDefaultLanguage().getId(); if (defaultLang != params.language.getId()) { cv = APILocator.getVersionableAPI().getContentletVersionInfo(argument, defaultLang); String inode = (params.mode.showLive) ? cv.getLiveInode() : cv.getWorkingInode(); Contentlet test = APILocator.getContentletAPI().find(inode, params.user, params.mode.respectAnonPerms); ContentType type = APILocator.getContentTypeAPI(APILocator.systemUser()).find(test.getContentTypeId()); if(type.baseType() == BaseContentType.CONTENT && !Config.getBooleanProperty("DEFAULT_CONTENT_TO_DEFAULT_LANGUAGE", false)){ throw new ResourceNotFoundException("cannnot find contentlet id " + argument + " lang:" + params.language); } else if(type.baseType() == BaseContentType.WIDGET && !Config.getBooleanProperty("DEFAULT_WIDGET_TO_DEFAULT_LANGUAGE", true)){ throw new ResourceNotFoundException("cannnot find widget id " + argument + " lang:" + params.language); } } } } catch (Exception e1) { throw new ResourceNotFoundException("cannnot find contentlet id " + argument + " lang:" + params.language); } final boolean showWorking = (context.get("_show_working_") != null && (boolean)context.get("_show_working_")); final StringBuilder path=new StringBuilder(); path.append(File.separator).append(!showWorking ? params.mode.name() : PageMode.PREVIEW_MODE.name()).append(File.separator) .append(argument).append(StringPool.UNDERLINE).append(cv.getLang()).append(StringPool.PERIOD).append(EXTENSION); return path.toString(); }