list static method

Implementation

static List<String>? list(TranslationMetadata meta, String path) {
  final node = meta.overrides[path];
  if (node == null) {
    return null;
  }
  if (node is! ListNode) {
    print('Overridden $path is not a ListNode but a ${node.runtimeType}.');
    return null;
  }
  if (node.genericType != 'String') {
    print('Overridden $path can only contain plain Strings.');
    return null;
  }

  return node.entries
      .map((e) => (e as StringTextNode).content.applyLinks(meta, {}))
      .toList();
}