Package play.api.i18n

Examples of play.api.i18n.Lang


                for (User receiver : usersByLang.get(langCode)) {
                    email.addBcc(receiver.email, receiver.name);
                }

                Lang lang = Lang.apply(langCode);

                String message = event.getMessage(lang);
                String urlToView = Url.create(event.getUrlToView());
                String reference = Url.removeFragment(event.getUrlToView());
View Full Code Here


  }

  public Html render(Form<?> form) {
    Field formField = form.field(fieldName);

    Lang lang = getLang();
    FieldConstructor fc = new FieldConstructor() {
      public Html apply(FieldElements elements) {
        return twitterBootstrapFieldConstructor.apply(elements);
      }
    };
View Full Code Here

  }

  protected abstract Html render(Field formField, Tuple2<Symbol, Object>[] args, FieldConstructor fieldConstructor, Lang lang);

  protected Lang getLang() {
    Lang lang = null;
    if (play.mvc.Http.Context.current.get() != null) {
      lang = play.mvc.Http.Context.current().lang();
    } else {
      Locale defaultLocale = Locale.getDefault();
      lang = new Lang(defaultLocale.getLanguage(), defaultLocale.getCountry());
    }
    return lang;
  }
View Full Code Here

TOP

Related Classes of play.api.i18n.Lang

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.