@wp-blocks/make-pot
    Preparing search index...

    Class JsonSchemaExtractor

    Extracts strings from JSON files using the I18n schema.

    Index

    Constructors

    Properties

    blockJsonFallback: __module = blocki18n
    blockJsonSource: string = "http://develop.svn.wordpress.org/trunk/src/wp-includes/block-i18n.json"

    Block

    themeJsonFallback: __module = themei18n
    themeJsonSource: string = "http://develop.svn.wordpress.org/trunk/src/wp-includes/theme-i18n.json"

    Theme

    Methods

    • Parses a string and extracts translations using the specified schema.

      Parameters

      • text: string

        the input string to be parsed

      • schema: { fallback: I18nSchema; url: string }

        the schema to use for parsing the input string

        • fallback: I18nSchema
        • url: string

          the URL of the schema to use for parsing the input string

      • options: { addReferences: boolean; file: "block.json" | "theme.json" }

        the options for parsing the input string

        • addReferences: boolean

          whether to add references to the extracted strings

        • file: "block.json" | "theme.json"

          the name of the file being parsed

      Returns Promise<Block[] | undefined>

      a promise that resolves with the extracted schema