Java 类org.springframework.context.support.ReloadableResourceBundleMessageSource 实例源码

项目:remember-me-back    文件:CorsConfiguration.java   
@Bean(name = "messageSource")
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageBundle = new ReloadableResourceBundleMessageSource();
    messageBundle.setBasename("classpath:messages/messages");
    messageBundle.setDefaultEncoding("UTF-8");
    return messageBundle;
}
项目:smarti    文件:SpeakService.java   
@PostConstruct
protected void initMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:messages/conversation");
    messageSource.setDefaultEncoding("utf-8");
    messageSource.setCacheSeconds(3600);

    if (externalResourceBundle != null) {
        ReloadableResourceBundleMessageSource external = new ReloadableResourceBundleMessageSource();
        external.setBasename(externalResourceBundle);
        external.setDefaultEncoding("utf-8");
        external.setCacheSeconds(500);
        external.setParentMessageSource(messageSource);

        this.messageSource = external;
    } else {
        this.messageSource = messageSource;
    }
}
项目:oma-riista-web    文件:LocalizationConfig.java   
@Bean(name = "messageSource")
public MessageSource messageSource() {
    // MessageSource configuration for localized messages.
    final ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();

    source.setBasenames("classpath:/i18n/messages", "classpath:ValidationMessages");
    source.setUseCodeAsDefaultMessage(true);
    source.setFallbackToSystemLocale(false);
    source.setDefaultEncoding(StandardCharsets.ISO_8859_1.name());

    if (runtimeEnvironmentUtil.isDevelopmentEnvironment()) {
        // Check for updates on every refresh, otherwise cache forever
        source.setCacheSeconds(1);
    }

    return source;
}
项目:konker-platform    文件:WebMvcConfig.java   
@Bean(name = "messageSource")
public MessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.addBasenames("classpath:/messages/alert-triggers");
    messageSource.addBasenames("classpath:/messages/applications");
    messageSource.addBasenames("classpath:/messages/device-model");
    messageSource.addBasenames("classpath:/messages/devices");
    messageSource.addBasenames("classpath:/messages/devices-config");
    messageSource.addBasenames("classpath:/messages/gateways");
    messageSource.addBasenames("classpath:/messages/locations");
    messageSource.addBasenames("classpath:/messages/rest-destination");
    messageSource.addBasenames("classpath:/messages/routes");
    messageSource.addBasenames("classpath:/messages/transformations");
    messageSource.addBasenames("classpath:/messages/users");
    messageSource.addBasenames("classpath:/messages/tenants");
    messageSource.addBasenames("classpath:/messages/health-alert");
    messageSource.addBasenames("classpath:/mail/MailMessages");
    messageSource.setDefaultEncoding("UTF-8");

    return messageSource;
}
项目:konker-platform    文件:MessageSouceTestConfiguration.java   
@Bean(name = "messageSource")
public MessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.addBasenames("classpath:/messages/alert-triggers");
    messageSource.addBasenames("classpath:/messages/applications");
    messageSource.addBasenames("classpath:/messages/device-model");
    messageSource.addBasenames("classpath:/messages/devices");
    messageSource.addBasenames("classpath:/messages/devices-config");
    messageSource.addBasenames("classpath:/messages/gateways");
    messageSource.addBasenames("classpath:/messages/locations");
    messageSource.addBasenames("classpath:/messages/rest-destination");
    messageSource.addBasenames("classpath:/messages/routes");
    messageSource.addBasenames("classpath:/messages/transformations");
    messageSource.addBasenames("classpath:/messages/users");
    messageSource.addBasenames("classpath:/messages/tenants");
    messageSource.addBasenames("classpath:/messages/health-alert");
    messageSource.addBasenames("classpath:/mail/MailMessages");
    messageSource.setDefaultEncoding("UTF-8");

    return messageSource;
}
项目:motech    文件:SwaggerGeneratorTest.java   
@Before
public void setUp() throws IOException {

    messageSource = new ReloadableResourceBundleMessageSource();
    ((ReloadableResourceBundleMessageSource) messageSource).setBasename("swagger-messages");

    swaggerGenerator.setSwaggerMessageSource(messageSource);

    try (InputStream in = getClass().getClassLoader().getResourceAsStream("swagger.properties")) {
        swaggerProperties = new Properties();
        swaggerProperties.load(in);
        swaggerGenerator.setSwaggerProperties(swaggerProperties);
        swaggerGenerator.setAllEntities(allEntities);
    }

    when(allEntities.retrieveAll()).thenReturn(entities());
}
项目:spring-web-extended    文件:SpringWebExtendedConfigurerConfig.java   
public void configureMessageSource(ReloadableResourceBundleMessageSource messageSource)
{
    ApplicationConfiguration appConfig = appConfig();

    MessageSourceConfig config = new DefaultMessageSourceConfig();
    config.addBaseName("WEB-INF/messages/Messages");
    config.setCacheSeconds(appConfig.isOptimizeResources() ? -1 : DEFAULT_REFRESH_INTERVALL);
    config.setDefaultEncoding("UTF-8");

    configurer.configureMessageSource(config);

    messageSource.setCacheSeconds(config.getCacheSeconds() != null ? config.getCacheSeconds() : -1);

    if (!CollectionUtils.isEmpty(config.getBaseNames()))
    {
        messageSource.setBasenames(config.getBaseNames().toArray(new String[config.getBaseNames().size()]));
    }

    messageSource.setDefaultEncoding(config.getDefaultEncoding());
}
项目:gocd    文件:LocalizerTest.java   
@Test
public void shouldReturnTheFormattedLocalizedMessage() {
    CurrentLocale locale = new CurrentLocale();
    ReloadableResourceBundleMessageSource source = new ReloadableResourceBundleMessageSource();
    source.setBasename("test_message");
    MessageSourceAccessor accessor = new MessageSourceAccessor(source);
    Localizer localizer = new Localizer(accessor, locale);

    assertThat(localizer.localize("hello_world"), is("Hello World"));

    locale.setLocaleString(Localizer.LOCALE_ENGLISH_US);
    assertThat(localizer.localize("MY_HOME", "San Francisco"), is("My home is San Francisco"));

    locale.setLocaleString(Localizer.LOCALE_KANNADA);
    assertThat(localizer.localize("MY_HOME", "ಬೆಂಗಳೂರು"), is("ನಮ್ಮ ಊರು ಬೆಂಗಳೂರು"));

    locale.setLocaleString(Localizer.LOCALE_KANNADA);
    assertThat(localizer.localize("MY_BIRTHDAY", new DateTime(1984, 12, 23, 14, 0, 0, 0, DateTimeZone.UTC).toDate()), is("ನನ್ನ ಹುಟ್ಟು ಹಬ್ಬ 12/23/84"));

    locale.setLocaleString(Localizer.LOCALE_ENGLISH_US);
    assertThat(localizer.localize("MY_BIRTHDAY", new DateTime(1984, 12, 23, 14, 0, 0, 0, DateTimeZone.UTC).toDate()), is("My birthday is 12/23/84"));

}
项目:fuwesta    文件:UrlDefinitionsToMessagesTest.java   
/**
 * Testet die Formatierung von URLs.
 */
@Test
public void testFormattedUrl() {
    // Additional check that the formating will be correct.
    final ReloadableResourceBundleMessageSource messageSource =
            new ReloadableResourceBundleMessageSource();
    final Long longValue = Long.valueOf(1100L);

    testee.addUrlsAsMessagesWithPositionedParameters();

    messageSource.setCommonMessages(testee.getMessages());
    assertThat(
            messageSource.getMessage("purl.testclass.edit",
                    new Object[] { longValue }, Locale.CANADA)).isEqualTo(
            TestClass.EDIT.replaceAll("\\{" + TestClass.P_USERID
                    + ":\\[A-Z\\]\\{1,2\\}\\}", "1100"));
    assertThat(
            messageSource.getMessage("purl.testclass.show", new Object[] {
                    longValue, longValue }, Locale.CANADA)).isEqualTo(
            TestClass.SHOW.replaceAll("\\{" + TestClass.P_USERNAME + "\\}",
                    "1,100"));
}
项目:ThymeleafSpringDemo    文件:I18NConfig.java   
@Bean
ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource bundleMessageSource = new ReloadableResourceBundleMessageSource();
    bundleMessageSource.setBasename("classpath:i18n/messages");
    bundleMessageSource.setCacheSeconds(1800);
    bundleMessageSource.setDefaultEncoding("UTF-8");
    return bundleMessageSource;
}
项目:buenojo    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:simple-hostel-management    文件:AdministrationController.java   
@RequestMapping(value = Mappings.ADMINISTRATION_ROOT, method = RequestMethod.GET)
public String showAdminPage(Model model, ReloadableResourceBundleMessageSource messageSource) throws Exception {

    model.addAttribute("locales", SpringConfiguration.AVAILABLE_LOCALES);
    model.addAttribute("currentLocale", LocaleContextHolder.getLocale());

    Mappings.includeMappings(model);
    return Templates.ADMINISTRATION;
}
项目:shoucang    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:security-demo    文件:WebConfiguration.java   
@Bean(name = "messageSource")
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource reloadMessage = new ReloadableResourceBundleMessageSource();
    reloadMessage.setBasename("classpath:/messages");
    reloadMessage.setDefaultEncoding("UTF-8");
    reloadMessage.setCacheSeconds(0);
    return reloadMessage;
}
项目:Spring-Security-Third-Edition    文件:WebMvcConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
项目:Spring-Security-Third-Edition    文件:WebMvcConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
项目:Spring-Security-Third-Edition    文件:WebMvcConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
项目:Spring-Security-Third-Edition    文件:WebMvcConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
项目:Spring-Security-Third-Edition    文件:WebMvcConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
项目:Spring-Security-Third-Edition    文件:WebMvcConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
项目:Spring-Security-Third-Edition    文件:WebMvcConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
项目:Spring-Security-Third-Edition    文件:WebMvcConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
项目:blogAggr    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:introducing-spring-framework    文件:WebConfig.java   
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageResource = new ReloadableResourceBundleMessageSource();
    messageResource.setBasenames("WEB-INF/i18n/messages");
    messageResource.setFallbackToSystemLocale(false);
    return messageResource;
}
项目:transandalus-backend    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:spring-boot-drools-example    文件:CommonConfig.java   
@Bean(name = "apiErrorMessageSource")
public ReloadableResourceBundleMessageSource apiErrorMessageSource() {
    ReloadableResourceBundleMessageSource messageBundle = new ReloadableResourceBundleMessageSource();
    messageBundle.setBasename("classpath:error_messages");
    messageBundle.setDefaultEncoding("UTF-8");
    messageBundle.setUseCodeAsDefaultMessage(true);
    return messageBundle;
}
项目:pswot-cloud-java-spring-webapp    文件:AppWebConfiguration.java   
@Bean
public MessageSource messageSource() { // Método para disponibilizar arquivos de mensagens
    ReloadableResourceBundleMessageSource bundle
            = new ReloadableResourceBundleMessageSource();
    bundle.setBasename("/WEB-INF/messages/messages");
    bundle.setDefaultEncoding("UTF-8");
    bundle.setCacheSeconds(1);
    return bundle;
}
项目:BCDS    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:konker-platform    文件:MessageSourceConfig.java   
@Bean(name = "messageSource")
public MessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.addBasenames(
            "/WEB-INF/i18n/dateformats",
            "/WEB-INF/i18n/destinations",
            "/WEB-INF/i18n/devices",
            "/WEB-INF/i18n/email",
            "/WEB-INF/i18n/error",
            "/WEB-INF/i18n/global",
            "/WEB-INF/i18n/languages",
            "/WEB-INF/i18n/loglevels",
            "/WEB-INF/i18n/menu",
            "/WEB-INF/i18n/routes",
            "/WEB-INF/i18n/timezones",
            "/WEB-INF/i18n/tokens",
            "/WEB-INF/i18n/transformations",
            "/WEB-INF/i18n/usernotifications",
            "/WEB-INF/i18n/users",
            "/WEB-INF/i18n/visualization",
            "classpath:/messages/alert-triggers",
            "classpath:/messages/applications",
            "classpath:/messages/device-model",
            "classpath:/messages/devices",
            "classpath:/messages/rest-destination",
            "classpath:/messages/routes",
            "classpath:/messages/transformations",
            "classpath:/messages/rest-destination",
            "classpath:/messages/users",
            "classpath:/messages/tenants",
            "classpath:/messages/applications",
            "classpath:/messages/device-model",
            "classpath:/messages/health-alert",
            "classpath:/mail/MailMessages");
    messageSource.setDefaultEncoding("UTF-8");
    return messageSource;
}
项目:konker-platform    文件:WebMvcConfig.java   
@Bean(name = "messageSource")
public MessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.addBasenames(
            "classpath:/messages/devices",
            "classpath:/messages/routes",
            "classpath:/messages/integration",
            "classpath:/messages/transformations",
            "classpath:/messages/devices-config",
            "classpath:/messages/applications");

    messageSource.setDefaultEncoding("UTF-8");
    return messageSource;
}
项目:konker-platform    文件:DeviceRegisterService.java   
public DeviceDataURLs(Device device, Locale locale) {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
       messageSource.setBasename("classpath:/messages/devices");
       messageSource.setDefaultEncoding("UTF-8");

       httpHostName = pubServerConfig.getHttpHostname();
       httpPort = pubServerConfig.getHttpPort();
       httpsPort = pubServerConfig.getHttpsPort();
       mqttHostName = pubServerConfig.getMqttHostName();
       mqttPort = pubServerConfig.getMqttPort();
       mqttTlsPort = pubServerConfig.getMqttTlsPort();
       context = pubServerConfig.getHttpCtx();
       channel = messageSource.getMessage("model.device.channel", null, locale);
       username = device.getApiKey();

       if (httpHostName.equalsIgnoreCase("localhost")) {
           this.httpHostName = "<ip>";
       }
       if (mqttHostName.equalsIgnoreCase("localhost")) {
        mqttHostName = "<ip>";
       }
       if (StringUtils.hasText(device.getApplication().getDataApiDomain())) {
        httpHostName = device.getApplication().getDataApiDomain();
       }        
       if (StringUtils.hasText(device.getApplication().getDataMqttDomain())) {
        mqttHostName = device.getApplication().getDataMqttDomain();
       }
}
项目:gameofcode    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:SMSC    文件:AppConfiguration.java   
@Primary
@Bean(name = "messageSource")
public ReloadableResourceBundleMessageSource messageSource() { // @todo not working
    ReloadableResourceBundleMessageSource messageBundle = new ReloadableResourceBundleMessageSource();
    messageBundle.setBasename("classpath:messages");
    messageBundle.addBasenames("classpath:messages", "classpath:validation");
    messageBundle.setUseCodeAsDefaultMessage(true);
    messageBundle.setDefaultEncoding("UTF-8");
    messageBundle.setFallbackToSystemLocale(true);

    return messageBundle;
}
项目:shoucang    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:communote-server    文件:ResourceBundleManager.java   
/**
 * default constructor
 */
private ResourceBundleManager() {
    basenames.add("classpath:com/communote/server/core/i18n/messages");
    basenames.add("classpath:com/communote/server/core/i18n/administration-messages");
    basenames.add("classpath:com/communote/server/core/i18n/installer-messages");
    messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setDefaultEncoding("UTF-8");
    messageSource.setBasenames(basenames.toArray(new String[basenames.size()]));
    messageSource.setFallbackToSystemLocale(false);
}
项目:oyd-pia    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:music-for-all-application    文件:LocaleConfig.java   
@Bean(name = "messageSource")
public ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource() {
    final ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasenames("classpath:locale");
    messageSource.setDefaultEncoding("UTF-8");
    return messageSource;
}
项目:jhipster-ionic    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}
项目:spring-noxml-crud    文件:WebAppConfig.java   
@Bean(name = "messageSource")
public ReloadableResourceBundleMessageSource getMessageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasename("classpath:/i18n/messages");
    resource.setDefaultEncoding("UTF-8");
    return resource;
}
项目:angularjs-springboot-bookstore    文件:ThymeleafConfiguration.java   
@Bean
@Description("Spring mail message resolver")
public MessageSource emailMessageSource() {
    log.info("loading non-reloadable mail messages resources");
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("classpath:/mails/messages/messages");
    messageSource.setDefaultEncoding(CharEncoding.UTF_8);
    return messageSource;
}