cacheEntries method
FutureOr<List<bool> ?>
cacheEntries(
- Map<
String, String> entries, - Map<
String, String> translations, - IntlLocale fromLocale,
- IntlLocale toLocale,
Cache translated entries
(if cache is provided).
Implementation
FutureOr<List<bool>?> cacheEntries(
Map<String, String> entries,
Map<String, String> translations,
IntlLocale fromLocale,
IntlLocale toLocale,
) {
var cache = this.cache;
if (cache == null) return null;
var results = entries.entries.map((e) {
var k = e.key;
var m = entries[k];
if (m == null || m.trim().isEmpty) return false;
var t = translations[k];
if (t == null || t.trim().isEmpty) return false;
return cache.store(k, m, t, fromLocale, toLocale);
}).resolveAll();
return results;
}