Adds localization to training y type skills

This commit is contained in:
José Lozano
2025-07-02 19:14:14 +02:00
parent b3884a350b
commit c9268ca316
4 changed files with 47 additions and 27 deletions
+25 -23
View File
@@ -176,7 +176,7 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
for (var i = 0; i < data.specialTraining.length; i++) {
let training = data.specialTraining[i];
training.attribute = game.i18n.localize(`DG.Skills.${training.key}`);
// training.attribute = game.i18n.localize(`DG.Skills.${training.key}`);
training.type = "training";
training.sortLabel = training.name.toUpperCase();
training.actorType = this.actor.type;
@@ -809,11 +809,11 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
htmlContent += ` <select name="new-type-skill-group" />`;
if (currentGroup === game.i18n.translations.DG?.TypeSkills?.Art ?? "Art") {
htmlContent += ` <option selected>${
htmlContent += ` <option value="Art" selected>${
game.i18n.translations.DG?.TypeSkills?.Art ?? "Art"
}</option>`;
} else {
htmlContent += ` <option>${
htmlContent += ` <option value="Art">${
game.i18n.translations.DG?.TypeSkills?.Art ?? "Art"
}</option>`;
}
@@ -822,11 +822,11 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
currentGroup === game.i18n.translations.DG?.TypeSkills?.Craft ??
"Craft"
) {
htmlContent += ` <option selected>${
htmlContent += ` <option value="Craft" selected>${
game.i18n.translations.DG?.TypeSkills?.Craft ?? "Craft"
}</option>`;
} else {
htmlContent += ` <option>${
htmlContent += ` <option value="Craft">${
game.i18n.translations.DG?.TypeSkills?.Craft ?? "Craft"
}</option>`;
}
@@ -835,12 +835,12 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
currentGroup === game.i18n.translations.DG?.TypeSkills?.ForeignLanguage ??
"Foreign Language"
) {
htmlContent += ` <option selected>${
htmlContent += ` <option value="ForeignLanguage" selected>${
game.i18n.translations.DG?.TypeSkills?.ForeignLanguage ??
"Foreign Language"
}</option>`;
} else {
htmlContent += ` <option>${
htmlContent += ` <option value="ForeignLanguage">${
game.i18n.translations.DG?.TypeSkills?.ForeignLanguage ??
"Foreign Language"
}</option>`;
@@ -850,12 +850,12 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
currentGroup === game.i18n.translations.DG?.TypeSkills?.MilitaryScience ??
"Military Science"
) {
htmlContent += ` <option selected>${
htmlContent += ` <option value="MilitaryScience" selected>${
game.i18n.translations.DG?.TypeSkills?.MilitaryScience ??
"Military Science"
}</option>`;
} else {
htmlContent += ` <option>${
htmlContent += ` <option value="MilitaryScience">${
game.i18n.translations.DG?.TypeSkills?.MilitaryScience ??
"Military Science"
}</option>`;
@@ -865,11 +865,11 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
currentGroup === game.i18n.translations.DG?.TypeSkills?.Pilot ??
"Pilot"
) {
htmlContent += ` <option selected>${
htmlContent += ` <option value="Pilot" selected>${
game.i18n.translations.DG?.TypeSkills?.Pilot ?? "Pilot"
}</option>`;
} else {
htmlContent += ` <option>${
htmlContent += ` <option value="Pilot">${
game.i18n.translations.DG?.TypeSkills?.Pilot ?? "Pilot"
}</option>`;
}
@@ -878,11 +878,11 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
currentGroup === game.i18n.translations.DG?.TypeSkills?.Science ??
"Science"
) {
htmlContent += ` <option selected>${
htmlContent += ` <option value="Science" selected>${
game.i18n.translations.DG?.TypeSkills?.Science ?? "Science"
}</option>`;
} else {
htmlContent += ` <option>${
htmlContent += ` <option value="Science">${
game.i18n.translations.DG?.TypeSkills?.Science ?? "Science"
}</option>`;
}
@@ -891,11 +891,11 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
currentGroup === game.i18n.translations.DG?.TypeSkills?.Other ??
"Other"
) {
htmlContent += ` <option selected>${
htmlContent += ` <option value="Other" selected>${
game.i18n.translations.DG?.TypeSkills?.Other ?? "Other"
}</option>`;
} else {
htmlContent += ` <option>${
htmlContent += ` <option value="Other">${
game.i18n.translations.DG?.TypeSkills?.Other ?? "Other"
}</option>`;
}
@@ -945,27 +945,27 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
game.i18n.translations.DG?.Skills?.SkillGroup ?? "Skill Group"
}:</label>`;
htmlContent += ` <select name="new-type-skill-group" />`;
htmlContent += ` <option>${
htmlContent += ` <option value="Art">${
game.i18n.translations.DG?.TypeSkills?.Art ?? "Art"
}</option>`;
htmlContent += ` <option>${
htmlContent += ` <option value="Craft">${
game.i18n.translations.DG?.TypeSkills?.Craft ?? "Craft"
}</option>`;
htmlContent += ` <option>${
htmlContent += ` <option value="ForeignLanguage">${
game.i18n.translations.DG?.TypeSkills?.ForeignLanguage ??
"Foreign Language"
}</option>`;
htmlContent += ` <option>${
htmlContent += ` <option value="MilitaryScience">${
game.i18n.translations.DG?.TypeSkills?.MilitaryScience ??
"Military Science"
}</option>`;
htmlContent += ` <option>${
htmlContent += ` <option value="Pilot">${
game.i18n.translations.DG?.TypeSkills?.Pilot ?? "Pilot"
}</option>`;
htmlContent += ` <option>${
htmlContent += ` <option value="Science">${
game.i18n.translations.DG?.TypeSkills?.Science ?? "Science"
}</option>`;
htmlContent += ` <option>${
htmlContent += ` <option value="Other">${
game.i18n.translations.DG?.TypeSkills?.Other ?? "Other"
}</option>`;
htmlContent += ` </select>`;
@@ -1084,7 +1084,9 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
([key, skill]) => ({
value: key,
group: optionGroups.typedSkills,
label: `${skill.group} (${skill.label})`,
label:
game.i18n.localize(`DG.TypeSkills.${skill.group}`) +
` (${skill.label})`,
targetNumber: skill.proficiency,
})
);
@@ -3,7 +3,7 @@
<div class="flex-group-center flex-mid-border">
<div class="">
<div class="physical-stats-outer-grid-3col">
<label class="rollable resource-label" data-rolltype="stat" data-key="{{key}}" title="{{localize 'DG.Tooltip.x5AttributeLabel'}}" for="system.statistics.{{key}}.value">{{localize (concat 'DG.Attributes.' key)}}</i></label>
<label class="rollable resource-label" data-rolltype="stat" data-key="{{key}}" title="{{localize (concat 'DG.Attributes.desc.' key)}}" for="system.statistics.{{key}}.value">{{localize (concat 'DG.Attributes.' key)}}</i></label>
<input type="text" name="system.statistics.{{key}}.value" value="{{statistic.value}}" data-dtype="Number"/>
<span class="rollable" data-rolltype="stat" data-key="{{key}}" title="{{localize 'DG.Tooltip.x5AttributeLabel'}}">({{numberFormat statistic.x5 decimals=0 sign=false}}% <i class="fas fa-dice"></i>)</span>
</div >
@@ -13,11 +13,13 @@
<div class="item flexrow flex-group-left flex-thin-border">
<div class="flexrow">
<label title="{{localize (concat 'DG.TypeSkills.desc.' skill.group)}}">
{{localize (concat 'DG.TypeSkills.' skill.group)}} ({{skill.label}})
</label>
<label class="{{if_gt skill.proficiency 0 'rollable' 'not-rollable'}} skill-label" data-key="{{skill.key}}" data-rolltype="skill" data-roll="d100" data-target="{{skill.proficiency}}" data-label="{{skill.label}}"
{{#if skill.proficiency}}title="{{localize 'DG.Tooltip.SkillLabel'}}"{{/if}}
{{#unless skill.proficiency}}title="{{localize 'DG.Tooltip.CannotRollSkillLabel'}}"{{/unless}}
>
{{skill.group}} ({{skill.label}})
<i class="fas fa-dice"></i>
</label>
<input class="percentile-skill-input" type="text" name="system.typedSkills.{{skill.key}}.proficiency" value="{{skill.proficiency}}" data-dtype="Number"/>
@@ -37,8 +39,22 @@
<div class="item flexrow flex-group-left flex-thin-border special-training-box">
<div class="flexrow">
{{#if_not_eq (localize (concat 'DG.Attributes.' skill.key)) (concat "DG.Attributes." skill.key)}}
<label title="{{localize (concat 'DG.Attributes.desc.' skill.key)}}">
{{skill.name}} ({{localize (concat 'DG.Attributes.' skill.key)}}, {{skill.targetNumber}}%)
</label>
{{else}}
{{#if_not_eq (localize (concat 'DG.Skills.' skill.key)) (concat "DG.Skills." skill.key)}}
<label title="{{localize (concat 'DG.Skills.desc.' skill.key)}}">
{{skill.name}} ({{localize (concat 'DG.Skills.' skill.key)}}, {{skill.targetNumber}}%)
</label>
{{else}}
<label>
{{skill.name}} ({{skill.attribute}}, {{skill.targetNumber}}%)
</label>
{{/if_not_eq}}
{{/if_not_eq}}
<label class="{{if_gt skill.targetNumber 0 'rollable' 'not-rollable'}}" data-key="{{skill.key}}" data-name="{{skill.name}}" data-rolltype="special-training">
{{skill.name}} ({{skill.attribute}}, {{skill.targetNumber}}%)
<i class="fas fa-dice"></i>
</label>
<div class="item-controls skill-and-training-controls">
+3 -1
View File
@@ -96,11 +96,13 @@
{{#if (hideSkillBasedOnProficiencyAndUserChoice ../actor.system.showUntrainedSkills skill.proficiency)}}
<div class="flexrow flex-group-left flex-thin-border">
<label title="{{localize (concat 'DG.Skills.desc.' skill.key)}}">
{{localizeWithFallback (concat "DG.Skills." skill.key) skill.label }}
</label>
<label class="{{if_gt skill.proficiency 0 'rollable' 'not-rollable'}} skill-label" data-rolltype="skill" data-roll="d100" data-key="{{skill.key}}" for="system.skills.{{skill.key}}.value"
{{#if skill.proficiency}}title="{{localize 'DG.Tooltip.SkillLabel'}}"{{/if}}
{{#unless skill.proficiency}}title="{{localize 'DG.Tooltip.CannotRollSkillLabel'}}"{{/unless}}
>
{{localizeWithFallback (concat "DG.Skills." skill.key) skill.label }}
<i class="fas fa-dice"></i>
</label>
<input class="percentile-skill-input" type="text" name="system.skills.{{skill.key}}.proficiency" value="{{skill.proficiency}}" data-dtype="Number" {{#if skill.isCalculatedValue}} disabled {{/if}}/>