mwg API
    Preparing search index...

    Function validateMessageAudio

    • Structural problems in a catalog's sound cues: an <type>.audio entry holding an empty string (the formatter already reads that as "no sound", so it is dead weight), or holding plural forms/a select message instead of a plain path. A sound path is data a game hands to mwg/audio's Sound, not grammar - count- or variant-dependent paths would silently reduce to one branch at lookup time rather than selecting one per play.

      Parameters

      Returns AudioIssue[]

      import { validateMessageAudio } from '@datamoc/mw_games/i18n';

      const catalog = {
      locale: 'en', direction: 'ltr' as const,
      messages: { 'hit.audio': '', 'loot.audio': { one: 'a.wav', other: 'b.wav' } },
      };

      console.log(validateMessageAudio(catalog).map((issue) => issue.key)); // ['hit.audio', 'loot.audio']