Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract with format minimal does not set defaults #222

Closed
disintegrator opened this issue Jun 8, 2018 · 4 comments
Closed

Extract with format minimal does not set defaults #222

disintegrator opened this issue Jun 8, 2018 · 4 comments

Comments

@disintegrator
Copy link

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/"
    ]
  }
}
@vsnig
Copy link

vsnig commented Jun 8, 2018

It can be fixed editing one string as I described in #199 (starting at "And this leads to another issue..."). #212 and #141 (comment) have similar complaints.
@tricoder42 should I create a PR?

@disintegrator
Copy link
Author

I agree with your suggested fixes in #199 @snegostup.

@tricoder42
Copy link
Contributor

@snegostup Sure, go for it! 👍

@tricoder42
Copy link
Contributor

Fixed and released in v2.2.0. Thanks to all involved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants