本文整理匯總了Java中play.i18n.Lang.preferred方法的典型用法代碼示例。如果您正苦於以下問題:Java Lang.preferred方法的具體用法?Java Lang.preferred怎麽用?Java Lang.preferred使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類play.i18n.Lang
的用法示例。
在下文中一共展示了Lang.preferred方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getVerifyEmailMailingBody
import play.i18n.Lang; //導入方法依賴的package包/類
@Override
protected Body getVerifyEmailMailingBody(final String token,
final MyUsernamePasswordAuthUser user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_VERIFICATION_LINK_SECURE);
final String url = routes.Signup.verify(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.account.signup.email.verify_email", langCode, url,
token, user.getName(), user.getEmail());
final String text = getEmailTemplate(
"views.txt.account.signup.email.verify_email", langCode, url,
token, user.getName(), user.getEmail());
return new Body(text, html);
}
示例2: getPasswordResetMailingBody
import play.i18n.Lang; //導入方法依賴的package包/類
protected Body getPasswordResetMailingBody(final String token,
final User user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_PASSWORD_RESET_LINK_SECURE);
final String url = routes.Signup.resetPassword(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.account.email.password_reset", langCode, url,
token, user.name, user.email);
final String text = getEmailTemplate(
"views.txt.account.email.password_reset", langCode, url, token,
user.name, user.email);
return new Body(text, html);
}
示例3: getVerifyEmailMailingBodyAfterSignup
import play.i18n.Lang; //導入方法依賴的package包/類
protected Body getVerifyEmailMailingBodyAfterSignup(final String token,
final User user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_VERIFICATION_LINK_SECURE);
final String url = routes.Signup.verify(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.account.email.verify_email", langCode, url, token,
user.name, user.email);
final String text = getEmailTemplate(
"views.txt.account.email.verify_email", langCode, url, token,
user.name, user.email);
return new Body(text, html);
}
示例4: getVerifyEmailMailingBody
import play.i18n.Lang; //導入方法依賴的package包/類
@Override
protected Body getVerifyEmailMailingBody(final String token,
final GSNUsernamePasswordAuthUser user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_VERIFICATION_LINK_SECURE);
final String url = controllers.gsn.auth.routes.Signup.verify(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.account.signup.email.verify_email", langCode, url,
token, user.getName(), user.getEmail());
final String text = getEmailTemplate(
"views.txt.account.signup.email.verify_email", langCode, url,
token, user.getName(), user.getEmail());
return new Body(text, html);
}
示例5: getPasswordResetMailingBody
import play.i18n.Lang; //導入方法依賴的package包/類
protected Body getPasswordResetMailingBody(final String token,
final User user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_PASSWORD_RESET_LINK_SECURE);
final String url = controllers.gsn.auth.routes.Signup.resetPassword(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.account.email.password_reset", langCode, url,
token, user.name, user.email);
final String text = getEmailTemplate(
"views.txt.account.email.password_reset", langCode, url, token,
user.name, user.email);
return new Body(text, html);
}
示例6: getVerifyEmailMailingBodyAfterSignup
import play.i18n.Lang; //導入方法依賴的package包/類
protected Body getVerifyEmailMailingBodyAfterSignup(final String token,
final User user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_VERIFICATION_LINK_SECURE);
final String url = controllers.gsn.auth.routes.Signup.verify(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.account.email.verify_email", langCode, url, token,
user.name, user.email);
final String text = getEmailTemplate(
"views.txt.account.email.verify_email", langCode, url, token,
user.name, user.email);
return new Body(text, html);
}
示例7: getVerifyEmailMailingBody
import play.i18n.Lang; //導入方法依賴的package包/類
@Override
protected Body getVerifyEmailMailingBody(final String token,
final MyUsernamePasswordAuthUser user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_VERIFICATION_LINK_SECURE);
final String url = routes.Signup.verify(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.common.account.signup.email.verify_email", langCode, url,
token, user.getName(), user.getEmail());
final String text = getEmailTemplate(
"views.txt.common.account.signup.email.verify_email", langCode, url,
token, user.getName(), user.getEmail());
return new Body(text, html);
}
示例8: getPasswordResetMailingBody
import play.i18n.Lang; //導入方法依賴的package包/類
protected Body getPasswordResetMailingBody(final String token,
final User user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_PASSWORD_RESET_LINK_SECURE);
final String url = routes.Signup.resetPassword(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.common.account.email.password_reset", langCode, url,
token, user.name, user.email);
final String text = getEmailTemplate(
"views.txt.common.account.email.password_reset", langCode, url, token,
user.name, user.email);
return new Body(text, html);
}
示例9: getVerifyEmailMailingBodyAfterSignup
import play.i18n.Lang; //導入方法依賴的package包/類
protected Body getVerifyEmailMailingBodyAfterSignup(final String token,
final User user, final Context ctx) {
final boolean isSecure = getConfiguration().getBoolean(
SETTING_KEY_VERIFICATION_LINK_SECURE);
final String url = routes.Signup.verify(token).absoluteURL(
ctx.request(), isSecure);
final Lang lang = Lang.preferred(ctx.request().acceptLanguages());
final String langCode = lang.code();
final String html = getEmailTemplate(
"views.html.common.account.email.verify_email", langCode, url, token,
user.name, user.email);
final String text = getEmailTemplate(
"views.txt.common.account.email.verify_email", langCode, url, token,
user.name, user.email);
return new Body(text, html);
}