message library Internationalization

🌐 JetLeaf Core Message

Provides infrastructure for message retrieval, internationalization (i18n), and localization in JetLeaf applications. This library allows developers to manage messages, load them from various sources, and support parent-child hierarchies for fallback message resolution.

πŸ”‘ Core Components

Message Source

  • message_source.dart β€” core interface for retrieving messages by key, supporting locale-specific lookups and parameterized messages.

Message Source Loader

  • message_source_loader.dart β€” strategy interface for loading messages from different sources and formats (e.g., JSON, YAML, properties files).

Abstract Message Source

  • abstract_message_source.dart β€” base implementation providing common functionality for message sources, including support for parent-child message resolution.

Configurable Message Source

  • configurable_message_source.dart β€” full-featured, configurable message source implementation with the ability to customize message loading, caching, and fallback mechanisms.

🎯 Intended Usage

Import this library to manage internationalized messages in JetLeaf:

import 'package:jetleaf_core/message.dart';

final messages = ConfigurableMessageSource();
messages.loadFromJson('messages_en.json');
final greeting = messages.getMessage('hello', locale: 'en');

Provides a standard foundation for i18n, message retrieval, and localization in JetLeaf applications.

Classes

AbstractMessageSource
Base implementation of MessageSource providing common functionality.
ConfigurableMessageSource
Main implementation of MessageSource that supports loading messages from multiple resources and formats.
MessageSource
Interface for resolving messages, with support for parameterization and internationalization.
MessageSourceLoader
Interface for loading messages from different resource formats.