@Override public Property getProperty(Node node, String name) throws RepositoryException { if (!isEnabled()) { return node.getProperty(name); } try { // test for the current language Locale locale = getLocale(); Set<Locale> checkedLocales = new HashSet<Locale>(); // getNextContentLocale() returns null once the end of the locale chain is reached while (locale != null) { Property property = getProperty(node, name, locale); if (!isEmpty(property)) { return property; } else if (locale.equals(getDefaultLocale()) && node.hasProperty(name)) { return node.getProperty(name); } checkedLocales.add(locale); locale = getNextContentLocale(locale, checkedLocales); } } catch (RepositoryException e) { log.error("can't read i18n property {} from node {}", name, node, e); } // return the node data return node.getProperty(name); }