diff --git a/lang/en.json b/lang/en.json index 7337dfd..edc0875 100644 --- a/lang/en.json +++ b/lang/en.json @@ -4,7 +4,6 @@ "DG.RollLuck": "Roll Luck", "DG.Luck": "Luck", - "DG.FallbackText.ProfessionAndOrRank": "PROFESSION (RANK IF APPLICABLE)", "DG.FallbackText.newItem": "New {type}", "DG.Skills.accounting": "Accounting", @@ -307,9 +306,11 @@ "DG.Sheet.BlockHeaders.PersonalInfoCV": "PERSONAL INFORMATION / CV", "DG.Sheet.BlockHeaders.BondsRelationshipsContacts": "BONDS / RELATIONSHIPS / CONTACTS", + "DG.AgentSheet.ProfessionPlaceholder": "PROFESSION (RANK IF APPLICABLE)", + "DG.UnnaturalSheet.HideUntrainedSkillsLabel": "Hide Untrained", "DG.UnnaturalSheet.NotesLabel": "Notes", - "DG.UnnaturalSheet.ShortDescriptionFallbackText": "Description of creature or creature type", + "DG.UnnaturalSheet.ShortDescriptionPlaceholder": "Description of creature or creature type", "DG.UnnaturalSheet.ShowUntrainedSkillsLabel": "Show Untrained", "DG.UnnaturalSheet.Tabs.NotesTabLabel": "Skills & Notes", "DG.UnnaturalSheet.Tabs.ItemsTabLabel": "Attacks & Abilities", diff --git a/module/sheets/base-actor-sheet.js b/module/sheets/base-actor-sheet.js index f280b3e..87cc157 100644 --- a/module/sheets/base-actor-sheet.js +++ b/module/sheets/base-actor-sheet.js @@ -68,6 +68,9 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { this.actor, ); + // Prepare subname info placeholder. + context.subnameInfoPlaceholder = this._prepareSubnameInfoPlaceholder(); + // Early return if this is a vehicle. if (this.actor.type === "vehicle") return context; @@ -174,6 +177,31 @@ export default class DGActorSheet extends DGSheetMixin(ActorSheetV2) { /* --------- Context Preparation Functions --------- */ + /** + * Prepares the subname info placeholder based on the actor type. + * Returns a localized string that acts as a placeholder for different + * types of actors, such as "unnatural", "vehicle", or defaulting to + * "agent" type. + * + * @returns {string} The localized placeholder string for the actor's subname info. + */ + _prepareSubnameInfoPlaceholder() { + let subnameInfoPlaceholder = ""; + switch (this.actor.type) { + case "unnatural": + subnameInfoPlaceholder = + "DG.UnnaturalSheet.ShortDescriptionPlaceholder"; + break; + case "vehicle": + subnameInfoPlaceholder = "DG.VehicleSheet.DescriptionPlaceHolder"; + break; + default: + subnameInfoPlaceholder = "DG.AgentSheet.ProfessionPlaceholder"; + break; + } + return game.i18n.localize(subnameInfoPlaceholder); + } + /** * Sorts the skills on the actor sheet based on the appropriate localized entry. * For the Japanese language, the sort label is the ruby text. diff --git a/templates/actor/parts/header.html b/templates/actor/parts/header.html index 9831979..d9bd858 100644 --- a/templates/actor/parts/header.html +++ b/templates/actor/parts/header.html @@ -23,7 +23,7 @@ + placeholder="{{subnameInfoPlaceholder}}" />