Example usage for com.liferay.portal.kernel.language LanguageUtil getLocale

List of usage examples for com.liferay.portal.kernel.language LanguageUtil getLocale

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.language LanguageUtil getLocale.

Prototype

public static Locale getLocale(String languageCode) 

Source Link

Usage

From source file:com.liferay.portlet.layoutsadmin.util.SitemapImpl.java

License:Open Source License

protected String buildI18NPath(Locale locale) {
    String languageId = LocaleUtil.toLanguageId(locale);

    if (Validator.isNull(languageId)) {
        return null;
    }/*from  w w  w.  j  av a 2s.  c om*/

    if (LanguageUtil.isDuplicateLanguageCode(locale.getLanguage())) {
        Locale priorityLocale = LanguageUtil.getLocale(locale.getLanguage());

        if (locale.equals(priorityLocale)) {
            languageId = locale.getLanguage();
        }
    } else {
        languageId = locale.getLanguage();
    }

    return StringPool.SLASH.concat(languageId);
}

From source file:com.tls.basiclti.BasicLTIUtil.java

License:Apache License

/**
 * Create the HTML to render a POST form and then automatically submit it.
 * Make sure to call {@link #cleanupProperties(Properties)} before signing.
 * /* w  w w .  j av a 2  s  .  c o  m*/
 * @deprecated Moved to {@link #postLaunchHTML(Map, String, boolean)}
 * @param cleanProperties
 *          Assumes you have called {@link #cleanupProperties(Properties)}
 *          beforehand.
 * @param endpoint
 *          The LTI launch url.
 * @param debug
 *          Useful for viewing the HTML before posting to end point.
 * @return the HTML ready for IFRAME src = inclusion.
 */
public static String postLaunchHTML(final Properties cleanProperties, String endpoint, boolean debug) {
    Map<String, String> map = convertToMap(cleanProperties);
    return postLaunchHTML(map, endpoint, debug, LanguageUtil.getLocale("es_ES"), false);
}