fromCode static method

Language? fromCode(
  1. String code
)

Returns the language based on the string code, and returns null if no match is found

Implementation

static Language? fromCode(String code) => switch (code) {
      ('ar') => Language.ar,
      ('bn') => Language.bn,
      ('cs') => Language.cs,
      ('da') => Language.da,
      ('de') => Language.de,
      ('el') => Language.el,
      ('en') => Language.en,
      ('es') => Language.es,
      ('fi') => Language.fi,
      ('fr') => Language.fr,
      ('gu') => Language.gu,
      ('hi') => Language.hi,
      ('hr') => Language.hr,
      ('it') => Language.it,
      ('ja') => Language.ja,
      ('ko') => Language.ko,
      ('nl') => Language.nl,
      ('no') => Language.no,
      ('pa') => Language.pa,
      ('pl') => Language.pl,
      ('pt') => Language.pt,
      ('ru') => Language.ru,
      ('sv') => Language.sv,
      ('te') => Language.te,
      ('zh') => Language.zh,
      (_) => null,
    };