當前位置: 首頁>>代碼示例>>Java>>正文


Java Lang.preferred方法代碼示例

本文整理匯總了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);
}
 
開發者ID:Vadus,項目名稱:songs_play,代碼行數:22,代碼來源:MyUsernamePasswordAuthProvider.java

示例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);
}
 
開發者ID:Vadus,項目名稱:songs_play,代碼行數:21,代碼來源:MyUsernamePasswordAuthProvider.java

示例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);
}
 
開發者ID:Vadus,項目名稱:songs_play,代碼行數:21,代碼來源:MyUsernamePasswordAuthProvider.java

示例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);
}
 
開發者ID:LSIR,項目名稱:gsn,代碼行數:22,代碼來源:GSNUsernamePasswordAuthProvider.java

示例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);
}
 
開發者ID:LSIR,項目名稱:gsn,代碼行數:21,代碼來源:GSNUsernamePasswordAuthProvider.java

示例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);
}
 
開發者ID:LSIR,項目名稱:gsn,代碼行數:21,代碼來源:GSNUsernamePasswordAuthProvider.java

示例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);
}
 
開發者ID:stefanil,項目名稱:play2-prototypen,代碼行數:22,代碼來源:MyUsernamePasswordAuthProvider.java

示例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);
}
 
開發者ID:stefanil,項目名稱:play2-prototypen,代碼行數:21,代碼來源:MyUsernamePasswordAuthProvider.java

示例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);
}
 
開發者ID:stefanil,項目名稱:play2-prototypen,代碼行數:21,代碼來源:MyUsernamePasswordAuthProvider.java


注:本文中的play.i18n.Lang.preferred方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。