load method

  1. @override
Future<Map<String, dynamic>> load(
  1. String path,
  2. Locale locale
)
override

Returns the translation map for locale from Firebase Remote Config.

The path parameter is required by the AssetLoader interface but is ignored — translations are sourced from Remote Config, not the asset bundle. The locale tag is formatted as languageCode or languageCode-countryCode when a country code is present.

Implementation

@override
Future<Map<String, dynamic>> load(String path, Locale locale) {
  final String localeTag = locale.countryCode != null ? '${locale.languageCode}-${locale.countryCode}' : locale.languageCode;
  _logger.info('[RemoteConfig] Loading translations for locale: $localeTag');
  return Future<Map<String, dynamic>>.value(_remoteConfigService.getTranslation(localeTag));
}