faker-js / faker

Generate massive amounts of fake data in the browser and node.js
https://fakerjs.dev
Other
11.86k stars 877 forks source link

feat(locale): add lorem for uz_UZ_latin #2824

Closed Mirazyzz closed 6 days ago

Mirazyzz commented 4 weeks ago
netlify[bot] commented 4 weeks ago

Deploy Preview for fakerjs ready!

Name Link
Latest commit eccf5226c354742ee1aad6394e77ae6a38171791
Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/6639d459884dfb000878a433
Deploy Preview https://deploy-preview-2824.fakerjs.dev
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.95%. Comparing base (043f68b) to head (eccf522).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #2824 +/- ## ========================================== - Coverage 99.96% 99.95% -0.01% ========================================== Files 2975 2977 +2 Lines 214451 215466 +1015 Branches 602 949 +347 ========================================== + Hits 214366 215377 +1011 - Misses 85 89 +4 ``` | [Files](https://app.codecov.io/gh/faker-js/faker/pull/2824?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=faker-js) | Coverage Δ | | |---|---|---| | [src/locales/uz\_UZ\_latin/index.ts](https://app.codecov.io/gh/faker-js/faker/pull/2824?src=pr&el=tree&filepath=src%2Flocales%2Fuz_UZ_latin%2Findex.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=faker-js#diff-c3JjL2xvY2FsZXMvdXpfVVpfbGF0aW4vaW5kZXgudHM=) | `100.00% <100.00%> (ø)` | | | [src/locales/uz\_UZ\_latin/lorem/index.ts](https://app.codecov.io/gh/faker-js/faker/pull/2824?src=pr&el=tree&filepath=src%2Flocales%2Fuz_UZ_latin%2Florem%2Findex.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=faker-js#diff-c3JjL2xvY2FsZXMvdXpfVVpfbGF0aW4vbG9yZW0vaW5kZXgudHM=) | `100.00% <100.00%> (ø)` | | | [src/locales/uz\_UZ\_latin/lorem/words.ts](https://app.codecov.io/gh/faker-js/faker/pull/2824?src=pr&el=tree&filepath=src%2Flocales%2Fuz_UZ_latin%2Florem%2Fwords.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=faker-js#diff-c3JjL2xvY2FsZXMvdXpfVVpfbGF0aW4vbG9yZW0vd29yZHMudHM=) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/faker-js/faker/pull/2824/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=faker-js)
Mirazyzz commented 4 weeks ago

What could be the root cause for the failing unit test: test/scripts/apidocs/verify-jsdoc-tags.spec.ts > verify JSDoc tags > phone > number > 0 > verify @example tag → Test timed out in 5000ms.? Can someone help me @ST-DDT @matthewmayer ?

xDivisionByZerox commented 4 weeks ago

We are currently analyzing the problem with the CI pipeline (see #2782). For now, any team member has to restart failed jobs. Sorry for the inconvenience :(

It's definitely not on your side, tho.

Mirazyzz commented 4 weeks ago

@ST-DDT can I ask you to perform code review?

ST-DDT commented 4 weeks ago

I'm currently busy, I'll review it when I have time.

matthewmayer commented 3 weeks ago

The English (well really fake Latin) words in lorem definitions are lowercase. Maybe do the same?

ST-DDT commented 3 weeks ago

The English (well really fake Latin) words in lorem definitions are lowercase. Maybe do the same?

It looks like Uz also has uppercase words, so IMO lorem can also contain them.

Mirazyzz commented 3 weeks ago

The words itself look fine, but IMO the purpose of lorem is creating a text that is not supposed to be read. So en and de use Latin for that. Why did you use actual words? (Or is it just google translate that assigns a translation to them even though they don't have any?)

If the intent is to use actual lorem I can change it though I was looking to Russian locale as an example and there were proper words, that's why I used the same approach. I thought these words could be used to generate some comments, messages etc. However, if you think it's better to keep it consistent I will do so :)

matthewmayer commented 3 weeks ago

My feeling is that most languages that use the Latin alphabet should probably just stick to the fake-Latin lorem so they don't need a locale-specific version of lorem. If you want "real" words you should use the word module.

Mirazyzz commented 3 weeks ago

My feeling is that most languages that use the Latin alphabet should probably just stick to the fake-Latin lorem so they don't need a locale-specific version of lorem. If you want "real" words you should use the word module.

Sounds reasonable. Should I copy the words from Latin locale then into Uzbek? Or should I take it from somewhere and export it from Uzbek locale?

matthewmayer commented 3 weeks ago

You probably don't have to do anything. All locales currently fall back to en and en already has the Latin lorem definitions.

ST-DDT commented 2 weeks ago

Team Decision

Mirazyzz commented 1 week ago

Team Decision

  • Languages that use latin characters should use the latin lorem text (e.g. copy it from en).
  • We will create a separate PR that will document this behavior of the lorem feature in the definitions and module.
  • We will create further PRs to add/fix the other locales according to their charset.

Sorry for the late fix. I copied words should I update the docs and create new PR for that?

xDivisionByZerox commented 1 week ago

Sorry for the late fix. I copied words should I update the docs and create new PR for that?

All good, no worries. The only thing you need to do is the bullet point one as you did in your latest commit f681ef6932639d7d6f965f47324a8cba4ce3c191.

The other bullet points are for us, the faker team, to remember certain decisions made.

matthewmayer commented 6 days ago

If it is identical to en could we not just have words.ts be like this to avoid duplication:

import words from '../../en/lorem/words';
export default words;
ST-DDT commented 6 days ago

I also considered this, but we could also do that in the mentioned cleanup PR. For me both works.

xDivisionByZerox commented 6 days ago

If it is identical to en could we not just have words.ts be like this to avoid duplication:

import words from '../../en/lorem/words';
export default words;

I'd suggest moving this to a separate PR as well. This way we can take the time to investigate if this is somehow influencing tree shaking for specific localized faker instances. I'd prefer to leave this kind of work to the faker team.

ST-DDT commented 6 days ago

I created a separate issue for the team todos:

Thank you @Mirazyzz for your contributions ❤️

Mirazyzz commented 1 day ago

I created a separate issue for the team todos:

Thank you @Mirazyzz for your contributions ❤️

@ST-DDT Thank you for constantly providing constructive feedback, it's a pleasure to contribute to your community and project. I myself enjoy using faker library and to planning to contribute more in the future!