Skip to content

feat: auto generate/update locale files#252

Merged
ST-DDT merged 13 commits into
faker-js:mainfrom
ST-DDT:feature/locales/autogenerate
Feb 1, 2022
Merged

feat: auto generate/update locale files#252
ST-DDT merged 13 commits into
faker-js:mainfrom
ST-DDT:feature/locales/autogenerate

Conversation

@ST-DDT

@ST-DDT ST-DDT commented Jan 21, 2022

Copy link
Copy Markdown
Member

This PR adds a script that automatically generates

  • src/locale/*.ts
  • src/locales/index.ts.
  • and docs/api/localization.md

This should be merged after #248

The is the generation/update related part for #210

Currently this is not integrated in the build process.

@netlify

netlify Bot commented Jan 21, 2022

Copy link
Copy Markdown

✔️ Deploy Preview for vigilant-wescoff-04e480 ready!

🔨 Explore the source changes: 93d4bc4

🔍 Inspect the deploy log: https://app.netlify.com/sites/vigilant-wescoff-04e480/deploys/61eb2c6b373a1c00072ae468

😎 Browse the preview: https://deploy-preview-252--vigilant-wescoff-04e480.netlify.app

Comment thread scripts/generateLocales.ts Outdated
Comment thread scripts/generateLocales.ts Outdated
@Shinigami92 Shinigami92 added the p: 1-normal Nothing urgent label Jan 21, 2022
@Shinigami92 Shinigami92 linked an issue Jan 21, 2022 that may be closed by this pull request
@ST-DDT

ST-DDT commented Jan 23, 2022

Copy link
Copy Markdown
Member Author

This has been split into multiple PRs and needs to be updated once #263 and #264 have been merged.

@ST-DDT ST-DDT marked this pull request as ready for review January 25, 2022 00:16
@ST-DDT ST-DDT requested a review from a team as a code owner January 25, 2022 00:16
@ST-DDT

ST-DDT commented Jan 25, 2022

Copy link
Copy Markdown
Member Author

Updated.

If the following change is considered breaking, then we could just temporarily remove/change it.
That way, we can still use the automation script.

- export = faker;
+ export default faker;
@Shinigami92

Copy link
Copy Markdown
Member

I thing export = faker is currently the right way, so plain js node users can just use const fakerDe = require('@faker-js/faker/locale/de') instead of const fakerDe = require('@faker-js/faker/locale/de').default.
So indeed, for the locales we have a special case here.

Comment thread package.json Outdated
Comment thread src/locale/en.ts
@ST-DDT ST-DDT requested a review from Shinigami92 January 27, 2022 14:36
Shinigami92
Shinigami92 previously approved these changes Jan 27, 2022

@Shinigami92 Shinigami92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 🚀

Shinigami92
Shinigami92 previously approved these changes Jan 27, 2022
@ST-DDT ST-DDT requested a review from a team January 27, 2022 18:48
@Shinigami92 Shinigami92 added this to the v6.0 - Project stability milestone Jan 28, 2022
@ST-DDT ST-DDT requested a review from Shinigami92 January 28, 2022 23:57
Comment thread scripts/generateLocales.ts Outdated
Shinigami92
Shinigami92 previously approved these changes Jan 29, 2022
@ST-DDT ST-DDT requested a review from a team January 29, 2022 12:07
@ST-DDT ST-DDT requested a review from Shinigami92 January 29, 2022 20:46
Shinigami92
Shinigami92 previously approved these changes Jan 29, 2022
@ST-DDT ST-DDT requested a review from Shinigami92 January 30, 2022 20:55
@ST-DDT ST-DDT requested a review from a team January 30, 2022 21:34
@ST-DDT

ST-DDT commented Jan 30, 2022

Copy link
Copy Markdown
Member Author

I need this in main in order to update it for #363 .
(There is no automation enabled for this yet.)

Comment thread CONTRIBUTING.md
@ST-DDT ST-DDT merged commit df48704 into faker-js:main Feb 1, 2022
@ST-DDT ST-DDT deleted the feature/locales/autogenerate branch February 1, 2022 17:06
bmenant pushed a commit to bmenant/faker that referenced this pull request Mar 11, 2022
demipel8 pushed a commit to demipel8/faker that referenced this pull request Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: 1-normal Nothing urgent

3 participants