extractTranslations method

Map<String, String>? extractTranslations(
  1. String key,
  2. Translation translations
)

Implementation

Map<String, String>? extractTranslations(
    String key, Translation translations) {
  if (translations.translations[key] case final Map<Lang, String> elements) {
    return elements.entries.fold({}, (acc, element) {
      return {...?acc, element.key.uid: element.value};
    });
  }

  return null;
}