当前位置: 首页>>代码示例>>Java>>正文


Java ResourceBundleMessageSource.setFallbackToSystemLocale方法代码示例

本文整理汇总了Java中org.springframework.context.support.ResourceBundleMessageSource.setFallbackToSystemLocale方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceBundleMessageSource.setFallbackToSystemLocale方法的具体用法?Java ResourceBundleMessageSource.setFallbackToSystemLocale怎么用?Java ResourceBundleMessageSource.setFallbackToSystemLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.context.support.ResourceBundleMessageSource的用法示例。


在下文中一共展示了ResourceBundleMessageSource.setFallbackToSystemLocale方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: defaultMessageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public MessageSource defaultMessageSource() {
    ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
    messageSource.setBasenames("messages", "i18n/messages");
    messageSource.setDefaultEncoding(Charset.forName("UTF-8").name());
    messageSource.setFallbackToSystemLocale(true);
    messageSource.setCacheSeconds(-1);
    messageSource.setAlwaysUseMessageFormat(false);
    messageSource.setUseCodeAsDefaultMessage(true);
    return messageSource;
}
 
开发者ID:xm-online,项目名称:xm-ms-entity,代码行数:12,代码来源:LocaleConfiguration.java

示例2: messageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
/**
 * @return ResourceBundleMessageSource pour les messages de l'application
 */
@Bean
public ResourceBundleMessageSource messageSource() {
	ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource();
	resourceBundleMessageSource.setBasenames(
			"i18n/messages",
			"i18n/backoffice/backoffice-messages",
			"i18n/backoffice/nomenclature-messages",
			"i18n/candidat/candidat-messages");
	resourceBundleMessageSource.setFallbackToSystemLocale(false);
	return resourceBundleMessageSource;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:15,代码来源:SpringConfig.java

示例3: createMessageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
/**
 * Create a MessageSource for the given basename,
 * to be used as MessageSource for the corresponding theme.
 * <p>Default implementation creates a ResourceBundleMessageSource.
 * for the given basename. A subclass could create a specifically
 * configured ReloadableResourceBundleMessageSource, for example.
 * @param basename the basename to create a MessageSource for
 * @return the MessageSource
 * @see org.springframework.context.support.ResourceBundleMessageSource
 * @see org.springframework.context.support.ReloadableResourceBundleMessageSource
 */
protected MessageSource createMessageSource(String basename) {
	ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
	messageSource.setBasename(basename);
	if (this.defaultEncoding != null) {
		messageSource.setDefaultEncoding(this.defaultEncoding);
	}
	if (this.fallbackToSystemLocale != null) {
		messageSource.setFallbackToSystemLocale(this.fallbackToSystemLocale);
	}
	if (this.beanClassLoader != null) {
		messageSource.setBeanClassLoader(this.beanClassLoader);
	}
	return messageSource;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:26,代码来源:ResourceBundleThemeSource.java

示例4: createValidator

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
public static Validator createValidator() {
  LocaleContextHolder.setLocale(Locale.ENGLISH);
  ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
  messageSource.setFallbackToSystemLocale(false);
  messageSource.setBasenames("validation");
  messageSource.setDefaultEncoding("utf8");

  LocalValidatorFactoryBean localValidator = new LocalValidatorFactoryBean();
  localValidator.setValidationMessageSource(messageSource);
  localValidator.afterPropertiesSet();
  return localValidator;
}
 
开发者ID:puncha,项目名称:petclinic,代码行数:13,代码来源:TestUtil.java

示例5: searchOperations

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean public ResourceBundleMessageSource searchOperations() {
    ResourceBundleMessageSource bundle = new ResourceBundleMessageSource();
    bundle.setFallbackToSystemLocale(false);
    bundle.setBasenames("com/jongsoft/harvester/service/operations");
    bundle.setBundleClassLoader(ServiceConfiguration.class.getClassLoader());
    return bundle;
}
 
开发者ID:gjong,项目名称:web-harvester,代码行数:8,代码来源:ServiceConfiguration.java

示例6: messageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public MessageSource messageSource() {
	ResourceBundleMessageSource result = new ResourceBundleMessageSource();
	result.setBasename("messages");
	result.setFallbackToSystemLocale(false);
	return result;
}
 
开发者ID:coinblesk,项目名称:coinblesk-server,代码行数:8,代码来源:BeanConfig.java

示例7: mailSetup

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Before
public void mailSetup() {
  configuration = new Configuration(Configuration.VERSION_2_3_21);
  configuration.setDefaultEncoding("UTF-8");
  configuration.setTemplateLoader(new ClassTemplateLoader(MailComposer.class, "/mail"));

  //keep config same as application.yml and WebConfiguration.java
  messageSource = new ResourceBundleMessageSource();
  messageSource.setBasename("i18n/messages");
  messageSource.setDefaultEncoding("UTF-8");
  messageSource.setFallbackToSystemLocale(false);
}
 
开发者ID:kaif-open,项目名称:kaif,代码行数:13,代码来源:MailTestCases.java

示例8: smsMessageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public ResourceBundleMessageSource smsMessageSource()
{
	final ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
	messageSource.setFallbackToSystemLocale(false);
	messageSource.setBasename("templates.sms.messages");
	return messageSource;
}
 
开发者ID:yonadev,项目名称:yona-server,代码行数:9,代码来源:ThymeleafConfiguration.java

示例9: emailMessageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public ResourceBundleMessageSource emailMessageSource()
{
	final ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
	messageSource.setFallbackToSystemLocale(false);
	messageSource.setBasename("templates.email.messages");
	return messageSource;
}
 
开发者ID:yonadev,项目名称:yona-server,代码行数:9,代码来源:ThymeleafConfiguration.java

示例10: buildSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
private ResourceBundleMessageSource buildSource(String basename, ClassLoader classLoader) {
    ResourceBundleMessageSource source = new ResourceBundleMessageSource();
    source.setDefaultEncoding(StandardCharsets.UTF_8.name());
    source.setFallbackToSystemLocale(false);
    source.setBasename(basename);

    if (classLoader == null) {
        classLoader = LocalizationServiceImpl.class.getClassLoader();
    }
    source.setBundleClassLoader(classLoader);

    return source;
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:14,代码来源:LocalizationServiceImpl.java

示例11: messageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public MessageSource messageSource() {
    ResourceBundleMessageSource ms = new ResourceBundleMessageSource();
    ms.setDefaultEncoding("UTF-8");
    ms.setFallbackToSystemLocale(false);
    ms.setBasename("i18n/messages");
    return ms;
}
 
开发者ID:asaas,项目名称:pebble-spring-translate,代码行数:9,代码来源:TestConfig.java

示例12: messageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public MessageSource messageSource() {
    ResourceBundleMessageSource source = new ResourceBundleMessageSource();
    source.setBasenames("alfio.i18n.public", "alfio.i18n.admin");
    //since we have all the english translations in the default file, we don't need
    //the fallback to the system locale.
    source.setFallbackToSystemLocale(false);
    source.setAlwaysUseMessageFormat(true);
    return source;
}
 
开发者ID:alfio-event,项目名称:alf.io,代码行数:11,代码来源:DataSourceConfiguration.java

示例13: messageSource

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
@Bean
public ResourceBundleMessageSource messageSource() {
	ResourceBundleMessageSource ms = new ResourceBundleMessageSource();
	ms.setBasenames(messageSourceBasenames);
	ms.setFallbackToSystemLocale(false);
	return ms;
}
 
开发者ID:hectorlf,项目名称:angularjs-test,代码行数:8,代码来源:AppConfiguration.java

示例14: SpringBundle

import org.springframework.context.support.ResourceBundleMessageSource; //导入方法依赖的package包/类
protected SpringBundle(String... baseNames) {
    source = new ResourceBundleMessageSource();
    source.setFallbackToSystemLocale(false);
    source.setBasenames(baseNames);
    source.setUseCodeAsDefaultMessage(true);
}
 
开发者ID:Talend,项目名称:data-prep,代码行数:7,代码来源:SpringBundle.java


注:本文中的org.springframework.context.support.ResourceBundleMessageSource.setFallbackToSystemLocale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。