Skip to content

yaml source type support  #45

@willin

Description

@willin

config:

const I18n = defineDocumentType(() => ({
  name: 'I18n',
  filePathPattern: 'i18n/*.yml',
  fileType: 'yaml',
  fields: {
    '*': { type: 'string' }
  }
}));

error msg:

Warning: Found problems in 2 of 4 documents. Skipping those documents.

 └──   2 documents contain field data which isn't defined in the document type definition
     
     • "i18n/en.yml" of type "I18n" has the following extra fields:
       • title: "Willin Wang"
       • subTitle: "Hello World!" 
     • "i18n/zh.yml" of type "I18n" has the following extra fields:
       • title: "王某人"
       • subTitle: "你好,世界!" 

data.yml.json:

{
  "_id": "i18n/en.yml",
  "_raw": {
    "sourceFilePath": "i18n/en.yml",
    "sourceFileName": "en.yml",
    "sourceFileDir": "i18n",
    "bodyType": "none",
    "flattenedPath": "i18n/en"
  },
  "type": "I18n"
}

how could i store localization messages?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions