diff --git a/locales/en.json b/locales/en.json index 1e47e6ca..81f977ae 100644 --- a/locales/en.json +++ b/locales/en.json @@ -273,6 +273,12 @@ "nbt_operation.target": "Target", "nbt_operation_add": "Add Operation", "nbt_operation_remove": "Remove Operation", + "placeholder.advancement": "An advancement ID", + "placeholder.block_state": "A block state key", + "placeholder.effect": "An status effect ID", + "placeholder.fluid_state": "A fluid state key", + "placeholder.objective": "An scoreboard objective", + "placeholder.recipe": "An recipe ID", "pool.bonus_rolls": "Bonus Rolls", "pool.rolls": "Rolls", "pool_add": "Add Pool", diff --git a/locales/zh-CN.json b/locales/zh-CN.json index 5e0e27f3..e0f9b662 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -270,6 +270,12 @@ "nbt_operation.target": "复制目标", "nbt_operation_add": "添加操作", "nbt_operation_remove": "移除操作", + "placeholder.advancement": "一个进度 ID", + "placeholder.block_state": "一个方块状态键", + "placeholder.effect": "一个状态效果 ID", + "placeholder.fluid_state": "一个流体状态键", + "placeholder.objective": "一个记分项", + "placeholder.recipe": "一个配方 ID", "pool.bonus_rolls": "每级幸运增加的抽取次数", "pool.rolls": "抽取次数", "pool_add": "添加随机池", diff --git a/schemas/1.15.json b/schemas/1.15.json index 1bf8aea9..a6859a82 100644 --- a/schemas/1.15.json +++ b/schemas/1.15.json @@ -638,6 +638,7 @@ "id": "properties", "type": "map", "translate": "condition.block_state", + "translatePlaceholder": "placeholder.block_state", "values": { "type": "string" }, @@ -649,6 +650,7 @@ "id": "scores", "type": "map", "translate": "condition.score", + "translatePlaceholder": "placeholder.objective", "values": { "type": "range" }, @@ -967,6 +969,7 @@ "id": "advancements", "type": "map", "translate": "entity.player.advancements", + "translatePlaceholder": "placeholder.advancement", "values": { "type": "boolean" } @@ -975,6 +978,7 @@ "id": "recipes", "type": "map", "translate": "entity.player.recipes", + "translatePlaceholder": "placeholder.recipe", "values": { "type": "boolean" } @@ -992,6 +996,7 @@ "id": "effects", "type": "map", "translate": "entity.status_effect", + "translatePlaceholder": "placeholder.effect", "values": { "type": "object", "value": "status_effect" @@ -1091,6 +1096,7 @@ "id": "state", "type": "map", "translate": "location.block.state", + "translatePlaceholder": "placeholder.block_state", "values": { "type": "string" } @@ -1118,6 +1124,7 @@ "id": "state", "type": "map", "translate": "location.fluid.state", + "translatePlaceholder": "placeholder.fluid_state", "values": { "type": "string" } diff --git a/view.js b/view.js index 117e8d27..07baf7ef 100644 --- a/view.js +++ b/view.js @@ -253,11 +253,13 @@ function generateSet(data, struct) { function generateMap(data, struct) { let $el = $('#components').find('[data-type="map"]').clone(); + let $input = $el.find('input') let out; $el.attr('data-index', struct.id).attr('data-item-type', struct.values.type); $el.find('[data-name="1"]').attr('data-i18n', struct.translate); $el.find('[data-name="2"]').attr('data-i18n', struct.translate + '_add'); - $el.find('input').keypress((e) => {if (e.which == 13) addToMap(e.target);}); + $input.attr('data-i18n', `[placeholder]${struct.translatePlaceholder}`); + $input.keypress((e) => {if (e.which == 13) addToMap(e.target);}); if (data) { for (let key of Object.keys(data)) { out = out || {}