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

describe principles of languages/countries to CONTRIBUTING guide #1383

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@ In order to keep Datafaker slim and focused the project generally attempts to av
- Minimal size (<1MB)
- No dependency tree (single level, the library itself)
- Fills a need we can't do "simply"


## Languages and countries

kingthorin marked this conversation as resolved.
Show resolved Hide resolved
Localization files are located in folder `src/main/resources`
kingthorin marked this conversation as resolved.
Show resolved Hide resolved
1. Country-specific values are stored in files `_COUNTRY.yml` (e.g. `_AL.yml` for Albania)
kingthorin marked this conversation as resolved.
Show resolved Hide resolved
* these are value that are the same in all languages in this country (e.g. phone country code, passport number pattern etc.)
kingthorin marked this conversation as resolved.
Show resolved Hide resolved
2. Language-specific values are stored in files `language.yml` (e.g. `it.yml` for Italian)
kingthorin marked this conversation as resolved.
Show resolved Hide resolved
* these are cities, streets, names etc. in that languages.
kingthorin marked this conversation as resolved.
Show resolved Hide resolved
3. In files `language-COUNTRY.yml`, we store values specific for this language and country
* e.g. `ru-MD.yml` contains Moldovan city names in Russian language (that is widely used in Moldova).

kingthorin marked this conversation as resolved.
Show resolved Hide resolved
After adding a new country or language, don't forget to update
* constant `net.datafaker.providers.base.Locality.LOCALES`
kingthorin marked this conversation as resolved.
Show resolved Hide resolved
* tests in `LocalityTest.java`
Loading