@Override
  public String getLanguageId(HttpServletRequest request) {
    String languageId = ParamUtil.getString(request, "languageId");

    if (Validator.isNotNull(languageId)) {
      CompanyLocalesBag companyLocalesBag = _getCompanyLocalesBag();

      if (companyLocalesBag.containsLanguageCode(languageId)
          || companyLocalesBag.containsLanguageId(languageId)) {

        return languageId;
      }
    }

    Locale locale = PortalUtil.getLocale(request);

    return getLanguageId(locale);
  }
  @Override
  public boolean isDuplicateLanguageCode(String languageCode) {
    CompanyLocalesBag companyLocalesBag = _getCompanyLocalesBag();

    return companyLocalesBag.isDuplicateLanguageCode(languageCode);
  }
  @Override
  public boolean isBetaLocale(Locale locale) {
    CompanyLocalesBag companyLocalesBag = _getCompanyLocalesBag();

    return companyLocalesBag.isBetaLocale(locale);
  }
  @Override
  public boolean isAvailableLocale(String languageId) {
    CompanyLocalesBag companyLocalesBag = _getCompanyLocalesBag();

    return companyLocalesBag.containsLanguageId(languageId);
  }
  @Override
  public Locale getLocale(String languageCode) {
    CompanyLocalesBag companyLocalesBag = _getCompanyLocalesBag();

    return companyLocalesBag.getByLanguageCode(languageCode);
  }
  @Override
  public Set<Locale> getAvailableLocales() {
    CompanyLocalesBag companyLocalesBag = _getCompanyLocalesBag();

    return companyLocalesBag.getAvailableLocales();
  }