# setMessageSource method

1. @override

void setMessageSource(

1. MessageSource messageSource

)
override

Sets the `MessageSource` used for resolving internationalized messages.

The message source provides internationalization (i18n) capabilities for applications that need to support multiple languages and locales.

### Message Source Features:

- Parameterized Messages: Support for placeholders and arguments
- Locale Resolution: Automatic locale detection and fallback
- Hierarchical Sources: Parent-child message source relationships
- Reloadable Bundles: Hot-reload of message bundles in development

### Example:

    // Set up a resource bundle message source
    final messageSource = ResourceBundleMessageSource();
    messageSource.setBasename('messages');
    messageSource.setDefaultEncoding('UTF-8');
    messageSource.setCacheSeconds(300); // Cache for 5 minutes

    context.setMessageSource(messageSource);

    // Usage in application components
    class InternationalizedService {
      final MessageSource messageSource;

      InternationalizedService(this.messageSource);

      String getWelcomeMessage(String username, Locale locale) {
        return messageSource.getMessage(
          'welcome.message',
          args: [username],
          locale: locale,
          defaultMessage: 'Welcome, $username!'
        );
      }
    }

## Implementation

    @override
    void setMessageSource(MessageSource messageSource) {
      _messageSource = messageSource;
    }