aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/faker.ts5
-rw-r--r--src/internal/locale-proxy.ts1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/faker.ts b/src/faker.ts
index 0b03788b..d9e9905b 100644
--- a/src/faker.ts
+++ b/src/faker.ts
@@ -120,7 +120,9 @@ export class Faker extends SimpleFaker {
* For more information see our [Localization Guide](https://fakerjs.dev/guide/localization.html).
*
* @param options The options to use.
- * @param options.locale The locale data to use.
+ * @param options.locale The locale data to use for this instance.
+ * If an array is provided, the first locale that has a definition for a given property will be used.
+ * Please make sure that all required locales and their parent locales are present, e.g. `[de_AT, de, en, base]`.
* @param options.randomizer The Randomizer to use.
* Specify this only if you want to use it to achieve a specific goal,
* such as sharing the same random generator with other instances/tools.
@@ -148,6 +150,7 @@ export class Faker extends SimpleFaker {
/**
* The locale data to use for this instance.
* If an array is provided, the first locale that has a definition for a given property will be used.
+ * Please make sure that all required locales and their parent locales are present, e.g. `[de_AT, de, en, base]`.
*
* @see mergeLocales(): For more information about how the locales are merged.
*/
diff --git a/src/internal/locale-proxy.ts b/src/internal/locale-proxy.ts
index dbb9f277..3e77a93a 100644
--- a/src/internal/locale-proxy.ts
+++ b/src/internal/locale-proxy.ts
@@ -72,6 +72,7 @@ export function assertLocaleData<T>(
} else if (value === undefined) {
throw new FakerError(
`The locale data for '${path.join('.')}' are missing in this locale.
+ If this is a custom Faker instance, please make sure all required locales are used e.g. '[de_AT, de, en, base]'.
Please contribute the missing data to the project or use a locale/Faker instance that has these data.
For more information see https://fakerjs.dev/guide/localization.html`
);