From a39577830351b36595a06c247234fac3a3d499b1 Mon Sep 17 00:00:00 2001 From: Lukas Obermann Date: Sat, 14 Jan 2023 12:23:34 +0100 Subject: [PATCH] fix: translation was not embedded in locale map --- docs/reference/traditionArtifacts/WeaponEnchantment.md | 9 +++++++++ schema/traditionArtifacts/WeaponEnchantment.schema.json | 9 ++++++++- src/types/traditionArtifacts/WeaponEnchantment.ts | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/reference/traditionArtifacts/WeaponEnchantment.md b/docs/reference/traditionArtifacts/WeaponEnchantment.md index 5e1631d2..3ec8dec0 100644 --- a/docs/reference/traditionArtifacts/WeaponEnchantment.md +++ b/docs/reference/traditionArtifacts/WeaponEnchantment.md @@ -64,6 +64,15 @@ Key | Description | Details All translations for the entry, identified by IETF language tag (BCP47). +- **Type:** Dictionary +- **Property Values:** WeaponEnchantment/translations[key] +- **Pattern:** `^[a-z]{2}-[A-Z]{2}$` +- **Minimum Properties:** `1` + +--- + +### `WeaponEnchantment/translations[key]` + - **Type:** WeaponEnchantmentTranslation --- diff --git a/schema/traditionArtifacts/WeaponEnchantment.schema.json b/schema/traditionArtifacts/WeaponEnchantment.schema.json index 5a74771c..df7dc1fc 100644 --- a/schema/traditionArtifacts/WeaponEnchantment.schema.json +++ b/schema/traditionArtifacts/WeaponEnchantment.schema.json @@ -39,7 +39,14 @@ }, "translations": { "description": "All translations for the entry, identified by IETF language tag (BCP47).", - "$ref": "#/$defs/WeaponEnchantmentTranslation" + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "#/$defs/WeaponEnchantmentTranslation" + } + }, + "minProperties": 1, + "additionalProperties": false } }, "required": [ diff --git a/src/types/traditionArtifacts/WeaponEnchantment.ts b/src/types/traditionArtifacts/WeaponEnchantment.ts index 7820bb6e..187d6107 100644 --- a/src/types/traditionArtifacts/WeaponEnchantment.ts +++ b/src/types/traditionArtifacts/WeaponEnchantment.ts @@ -6,6 +6,7 @@ import { validateSchemaCreator } from "../../validation/schema.js" import { Errata } from "../source/_Erratum.js" import { PublicationRefs } from "../source/_PublicationRef.js" import * as Activatable from "../_Activatable.js" +import { LocaleMap } from "../_LocaleMap.js" import { GeneralPrerequisites } from "../_Prerequisite.js" /** @@ -35,7 +36,7 @@ export type WeaponEnchantment = { /** * All translations for the entry, identified by IETF language tag (BCP47). */ - translations: WeaponEnchantmentTranslation + translations: LocaleMap } export type WeaponEnchantmentTranslation = {