Package org.broadleafcommerce.common.i18n.domain

Examples of org.broadleafcommerce.common.i18n.domain.TranslationImpl


            translation = (Translation) countryValue.getObjectValue();
        } else {
            statisticsService.addCacheStat(CacheStatType.TRANSLATION_CACHE_HIT_RATE.toString(), false);
            translation = getTranslation(entityType, entityId, property, localeCountryCode);
            if (translation == null) {
                translation = new TranslationImpl();
            }
            getCache().put(new Element(countryCacheKey, translation));
        }
       
        // If we don't find one, let's try just the language (en), again utilizing the cache
        if (translation.getTranslatedValue()==null) {
            String nonCountryCacheKey = getCacheKey(entityType, entityId, property, localeCode);
            Element nonCountryValue = getCache().get(nonCountryCacheKey);
            if (nonCountryValue != null) {
                statisticsService.addCacheStat(CacheStatType.TRANSLATION_CACHE_HIT_RATE.toString(), true);
                translation = (Translation) nonCountryValue.getObjectValue();
            } else {
                statisticsService.addCacheStat(CacheStatType.TRANSLATION_CACHE_HIT_RATE.toString(), false);
                translation = getTranslation(entityType, entityId, property, localeCode);
                if (translation == null) {
                    translation = new TranslationImpl();
                }
                getCache().put(new Element(nonCountryCacheKey, translation));
            }
        }
       
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.common.i18n.domain.TranslationImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.