Make locked door alert messages localizable (fixes #15)

This commit is contained in:
2022-01-17 11:29:11 +01:00
parent d51c416ac2
commit 7fd6f1f9a9
2 changed files with 5 additions and 1 deletions

View File

@@ -25,6 +25,7 @@
}
},
"ui": {
"lockedDoorAlert": "Just tried to open a locked door",
"messages": {
"migrating": "Migrating Smart Doors to version {version}. Please don't close the application.",
"migrationDone": "Smart Doors successfully migrated to version {version}.",

View File

@@ -22,6 +22,9 @@ export function onRenderChatMessage(message, html, data) {
sourceDoor.icon.tint = 0xffffff;
}
html.on("mouseleave", mouseLeave);
// Localize the message
html.find(".message-content")[0].innerText = game.i18n.localize("smart-doors.ui.lockedDoorAlert");
}
// Creates a chat message stating that a player tried to open a locked door
@@ -46,7 +49,7 @@ export function onDoorLeftClick() {
message.user = game.user.id;
if (game.user.character)
message.speaker = {actor: game.user.character}
message.content = "Just tried to open a locked door"
message.content = game.i18n.localize("smart-doors.ui.lockedDoorAlert");
message.sound = CONFIG.sounds.lock
message.flags = {smartdoors: {source: {wall: this.wall.data._id, scene: this.wall.scene.id}}}
ChatMessage.create(message)