localizeList method
Tries to localize text by given key
.
days:
"monday", "tuesday", "wednesday"
Enable/Disable debug mode to show/hide missing localizations.
Implementation
Iterable<String> localizeList(String key) {
if (_data.containsKey(key)) {
final data = _data[key];
if (data is List) {
return data.cast<String>();
}
if (data is Map) {
return data.values.cast<String>();
}
return [_data[key]];
}
return debug ? ['${key}_$_locale'] : [];
}