loadLocale method
Loads the translations of the given locale if not already loaded.
Implementation
Future<void> loadLocale(E locale) async {
if (translationMap.containsKey(locale)) {
// already loaded
return;
}
if (translationsLoading.contains(locale)) {
// already loading
return;
}
translationsLoading.add(locale);
translationMap[locale] = await locale.build();
translationsLoading.remove(locale);
}