load method

Future<void> load(
  1. Locale locale
)

Load translations for a locale

Implementation

Future<void> load(Locale locale) async {
  try {
    final path = assetPathBuilder(locale);
    final jsonString = await rootBundle.loadString(path);
    _translations = json.decode(jsonString);
    _currentLocale = locale;
    notifyListeners();
  } catch (e) {
    debugPrint('Failed to load translations for $locale: $e');
  }
}