Skip to content

feat(locale): add food data for ko - #4263

Open
nococn wants to merge 15 commits into
faker-js:nextfrom
nococn:feat/locale-ko-food
Open

nococn wants to merge 15 commits into
faker-js:nextfrom
nococn:feat/locale-ko-food

Conversation

@nococn

@nococn nococn commented Nov 9, 2026

Copy link
Copy Markdown

What is the reason for this PR?

The ko locale has no food module, so calls like fakerKO.food.dish() fall back to English values when generating Korean test data. The ja locale already ships food data; this PR adds the equivalent dataset for ko.

What changed

  • Adds src/locales/ko/food/ with 10 definition modules (adjective, description_pattern, dish, dish_pattern, ethnic_category, fruit, ingredient, meat, spice, vegetable) plus its index, registered in the ko locale definition.
  • Structure mirrors the existing en/ja food data; entries are sorted by Korean collation.
  • Updates the locale-data snapshot accordingly.

@nococn
nococn requested a review from a team as a code owner November 9, 2026 01:40
@netlify

netlify Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for fakerjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2e65727
🔍 Latest deploy log https://app.netlify.com/projects/fakerjs/deploys/6af206cb87009e92148e6437
😎 Deploy Preview https://deploy-preview-4263.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.14%. Comparing base (5415aec) to head (2e65727).

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #4263   +/-   ##
=======================================
  Coverage   99.14%   99.14%           
=======================================
  Files        1179     1180    +1     
  Lines        3976     3977    +1     
  Branches      723      709   -14     
=======================================
+ Hits         3942     3943    +1     
  Misses         29       29           
  Partials        5        5           
Files with missing lines Coverage Δ
src/locales/ko/food/index.ts 100.00% <100.00%> (ø)
src/locales/ko/index.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: locale Permutes locale definitions m: food Something is referring to the food module labels Nov 9, 2026
@ST-DDT ST-DDT added this to the v11.0 milestone Nov 9, 2026
ST-DDT
ST-DDT previously approved these changes Nov 9, 2026

@ST-DDT ST-DDT 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.

  1. Are you familiar with KO language?
  2. Please limit yourself to 1-2 locale PRs at a time, otherwise you may run into merge conflicts
  3. We currently have little review capacity, so if you know somebody that is familiar with KO, please sk them to review the PR.

Comment thread src/locales/ko/food/dish_pattern.ts Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Korean food templates use fixed particles that do not match all substituted nouns, producing grammatically incorrect dish names and descriptions.

1 open issue
What changed in this PR

Adds Korean food data to Faker’s ko locale so food generation uses localized values instead of English fallbacks.

Changes:

  • Adds ten food datasets covering dish names, templates, ingredients, and related categories.
  • Registers the food definitions in the Korean locale.
  • Updates the locale character snapshot for the new Korean text.
File Description
test/​__snapshots__/​locale-data.spec.ts.snap Updates the Korean character inventory.
src/​locales/​ko/​index.ts Registers Korean food definitions.
src/​locales/​ko/​food/​vegetable.ts Adds vegetable names.
src/​locales/​ko/​food/​spice.ts Adds spices and seasonings.
src/​locales/​ko/​food/​meat.ts Adds meat and cut names.
src/​locales/​ko/​food/​ingredient.ts Adds cooking ingredients.
src/​locales/​ko/​food/​index.ts Exports the food definition modules.
src/​locales/​ko/​food/​fruit.ts Adds fruit names.
src/​locales/​ko/​food/​ethnic_category.ts Adds cuisine categories.
src/​locales/​ko/​food/​dish.ts Adds Korean dish names.
src/​locales/​ko/​food/​dish_pattern.ts Adds generated dish-name templates.
src/​locales/​ko/​food/​description_pattern.ts Adds food-description templates.
src/​locales/​ko/​food/​adjective.ts Adds food-related adjectives.

Review effort: Balanced

Comment thread src/locales/ko/food/dish_pattern.ts Resolved
@nococn

nococn commented Nov 9, 2026

Copy link
Copy Markdown
Author

Hi @ST-DDT, thank you for the feedback and guidance!

  1. Korean familiarity: Yes, I am a native Korean speaker and developer based in Korea.
  2. PR limit: I apologize for opening multiple PRs at once—I got overly excited about getting the Korean locale supported. I've closed feat(locale): add finance data for ko #4266 for now to keep things strictly to 1-2 PRs (feat(locale): add food data for ko #4263 and feat(locale): add vehicle data for ko #4265) and prevent any merge conflicts.
  3. Food module updates:
    • Fixed the spacing suggestion on dish_pattern.ts.
      • Refactored dish_pattern.ts and description_pattern.ts so postposition particles attach only to invariant words rather than randomly picked ingredients, eliminating any particle agreement issues (e.g., 을/를, 과/와, 로/으로).
        • Cleaned up ethnic_category.ts to base country names so patterns like {{food.ethnic_category}}풍 {{food.meat}}찜 generate natural expressions like 한국풍 갈비찜.

          • Re-verified test suite and synchronized the snapshot.

          Whenever you have time to review, please feel free to take a look. Thank you!

@ST-DDT

ST-DDT commented Nov 9, 2026

Copy link
Copy Markdown
Member

2. I apologize for opening multiple PRs at once—I got overly excited about getting the Korean locale supported.

No problem, glad you liked it.

Whenever you have time to review, please feel free to take a look.

I've reviewed it and it looks good.
Please note, that a maintainer needs to review this before it can be merged. (I'm not a maintainer)
So it may take a while before it can be merged.

Thanks for contributing ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: locale Permutes locale definitions m: food Something is referring to the food module p: 1-normal Nothing urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants