public String getSeparator() {
return separator;
}
public void writeTag() throws IOException, JspException {
SiteMap siteMap = webSite.getSiteMap();
boolean notTranslatable =
pagePath.isRoot() || siteMap.getPageInfo(pagePath) == null;
List langList = siteMap.getLangList();
if (langList.size() > 1) {
Iterator iter = langList.iterator();
boolean putSeparator = false;
Writer w = getOut();
if (pre != null) {
w.write(pre);
}
Path baseIconPath = Utils.isTrue(flags) ? webSite.getAdminPath().add("flags") : null;
while (iter.hasNext()) {
if (putSeparator) {
w.write(separator);
}
putSeparator = true;
SiteMap.CodeLocalePair lang = (SiteMap.CodeLocalePair) iter.next();
String langCode = lang.getCode();
String localeName = Utils.encodeHTML(lang.getName());
Path link = null;
String onClick = null;
if (notTranslatable) {
link = webSite.getLink(new Path(langCode), pageDirPath);
} else {
if (!langCode.equalsIgnoreCase(pagePath.getElementAt(0))) {
Path path = siteMap.getServedPath(pagePath.replace(0, langCode));
if (!webSite.getFile(path).isFile()) {
if (userInfo != null && userInfo.canWrite(webSite, path)) {
PageInfo ppi = siteMap.getParentPageInfo(pagePath);
if (ppi != null && ppi.getLevel() > 0) {
Path pPath = ppi.getPath().replace(0, langCode);
if (siteMap.getPageInfo(pPath) != null) {
ResourceBundle bundle =
ResourceBundle.getBundle("org/meshcms/webui/Locales",
WebUtils.getPageLocale(pageContext));
String msg = Utils.replace(bundle.getString("confirmTranslation"),
'\'', "\\'");