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

RFC-002 - Catalogs #326

Merged
merged 46 commits into from
May 23, 2019
Merged

RFC-002 - Catalogs #326

merged 46 commits into from
May 23, 2019

Conversation

tricoder42
Copy link
Contributor

@tricoder42 tricoder42 commented Sep 12, 2018

Implementation of RFC-002

Resolves #257

Work in progress:

  • Deprecate configuration, add catalogs
  • Add locales to configuration
  • Extract messages -> create message files (POT)
  • Create translation files (PO)
  • Support exlude pattern
  • Documentation: update @lingui/conf reference
  • Documentation: add guide about catalogs, deprecate guide about ignoring files

In next batch:

  • Load messages from script

@codecov
Copy link

codecov bot commented Sep 22, 2018

Codecov Report

❗ No coverage uploaded for pull request base (next@33c7910). Click here to learn what that means.
The diff coverage is 81.58%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next     #326   +/-   ##
=======================================
  Coverage        ?   84.11%           
=======================================
  Files           ?       37           
  Lines           ?     1190           
  Branches        ?      294           
=======================================
  Hits            ?     1001           
  Misses          ?      118           
  Partials        ?       71
Impacted Files Coverage Δ
packages/cli/src/api/formats/minimal.ts 70% <ø> (ø)
packages/cli/src/api/formats/lingui.ts 0% <ø> (ø)
packages/cli/src/api/detect.ts 64.7% <ø> (ø)
packages/cli/src/api/extractors/typescript.ts 11.76% <0%> (ø)
packages/cli/src/api/formats/po.ts 100% <100%> (ø)
packages/cli/src/api/compat.ts 25.92% <100%> (ø)
packages/cli/src/tests.ts 100% <100%> (ø)
packages/react/src/I18nProvider.tsx 92.85% <100%> (ø)
packages/loader/src/index.js 81.25% <100%> (ø)
packages/react/src/Trans.tsx 85.71% <100%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33c7910...a05d40c. Read the comment docs.

@yaitskov
Copy link

and?

@zagoa
Copy link

zagoa commented Mar 25, 2019

Any news on this ?

@tricoder42
Copy link
Contributor Author

Hey @abhashmi, @ahmed-belal, @alexarnautu, @Photonios and @cipix2000! 👋

I saw your great work in lingui-multi. New configuration for catalogs seems to solve exactly the same problem. I wonder if you could give me your feedback on this RFC? I'm planning to merge it into pre-release this week.

The PR is almost ready, I'm just thinking about the final format of configuration:

mapping {[path: string]: CatalogConfig}

{
   "lingui": {
      "catalogs": {
         "./locale/{locale}/shared": [
            ".",
            "!./node_modules/"
         ],
         "./locale/{locale}/graphql": "run!scripts/fetch_graphql_enums.js",
         "./components/{name}/locale/{locale}": "./components/{name}/",
      }
   }
}

list of catalog configs

{
   "lingui": [
      {
         "path": "./locale/{locale}/shared",
         "include": ["."],
         "exclude": ["node_modules"]
      },
      {
         "path": "./locale/{locale}/graphql",
         "include": [{
            "type": "script",
            "path": "scripts/fetch_graphql_enums.js"
         }],
      },
      {
         "path": "./components/{name}/locale/{locale},
         "include": [./components/{name}/"],
         "exclude": ["node_modules"]
      }
   }
}

I think I tried both, because most of codebase uses the first format, while one part uses the second format. It's probably unimportant, but the first one seems to be more readable, while the second one is more explicit.

What do you think?

@tricoder42 tricoder42 mentioned this pull request May 20, 2019
If it's used, it complains about invalid syntax in TS types and
interfaces without dangling commas.
@tricoder42 tricoder42 merged commit 73792e2 into next May 23, 2019
@tricoder42 tricoder42 deleted the rfc/002-catalogs branch May 23, 2019 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants