Skip to content

Extract with format minimal does not set defaults #222

@disintegrator

Description

@disintegrator

When the extract format is set to minimal, the extract command is not correctly setting the default message for the source locale. It does however work fine when the format is set to lingui

Given:

<Trans id="userpage.tabs.items">Items</Trans>

Command:

yarn lingui extract

Output (locale/en/messages.json):

{
  "userpage.tabs.items": "userpage.tabs.items"
}

Expected:

{
  "userpage.tabs.items": "Items"
}

Config including package versions (extract from my package.json):

{
  "dependencies": {
    "@lingui/react": "^2.0.8",
    "react": "^16.4.0",
    "react-dom": "^16.4.0"
  },
  "devDependencies": {
    "@lingui/babel-preset-react": "^2.0.8",
    "@lingui/cli": "^2.0.8",
  },
  "lingui": {
    "fallbackLocale": "en",
    "sourceLocale": "en",
    "localeDir": "<rootDir>/locale",
    "format": "minimal",
    "srcPathIgnorePatterns": [
      "/node_modules/",
      "<rootDir>/\\.next/",
      "<rootDir>/dist/",
      "<rootDir>/geolite2-country/"
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions