Skip to content

Commit

Permalink
Merge pull request #152 from mhilbrunner/locale-fixes
Browse files Browse the repository at this point in the history
Localization fixes
  • Loading branch information
Savantford committed Feb 23, 2024
2 parents d6e4272 + 87a6394 commit 7e34672
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
15 changes: 8 additions & 7 deletions lang/en.json
Expand Up @@ -45,6 +45,8 @@
"WW.Defense.Bonus": "Bonus to Defense",
"WW.Defense.Details": "(armor, if any, shield, if any)",

"WW.Dialog.Cancel": "Cancel",

"WW.Health.Label": "Health",
"WW.Health.Normal": "Normal Health Score",
"WW.Health.Current": "Current Health Score",
Expand Down Expand Up @@ -73,7 +75,7 @@
"WW.Damage.AttackMod": "Extra Damage modifier for Attacks",
"WW.Damage.OtherDice": "Extra Damage dice (Other sources)",
"WW.Damage.OtherMod": "Extra Damage modifier (Other sources)",
"WW.Damage.Of": "Damage of",
"WW.Damage.Of": "Damage of {name}",
"WW.Damage.BothHands": "In Both Hands (Versatile)",

"WW.Rest.Label": "Rest",
Expand Down Expand Up @@ -116,7 +118,7 @@
"WW.Detail.Tradition.Label": "Traditions",
"WW.Detail.Tradition.New": "New Tradition",
"WW.Detail.Tradition.Add": "Add new tradition",
"WW.Detail.Tradition.Edit": "Edit immunity",
"WW.Detail.Tradition.Edit": "Edit tradition",
"WW.Detail.Tradition.Remove": "Remove tradition",

"WW.Item.Name": "Name",
Expand All @@ -143,7 +145,7 @@
"WW.Item.Add.Equipment": "Add Equipment",
"WW.Item.Add.Weapon": "Add Weapon",
"WW.Item.Add.Spell": "Add Spell",
"WW.Item.Add.Attack": "Add Weapon",
"WW.Item.Add.Attack": "Add Attack",
"WW.Item.Add.Ancestry": "Add Ancestry",
"WW.Item.Add.Profession": "Add Profession",
"WW.Item.Add.NovicePath": "Add Novice Path",
Expand All @@ -154,7 +156,7 @@
"WW.Item.Edit.Equipment": "Edit Equipment",
"WW.Item.Edit.Weapon": "Edit Weapon",
"WW.Item.Edit.Spell": "Edit Spell",
"WW.Item.Edit.Attack": "Edit Weapon",
"WW.Item.Edit.Attack": "Edit Attack",
"WW.Item.Edit.Fury": "Edit Fury",
"WW.Item.Edit.Ancestry": "Edit Ancestry",
"WW.Item.Edit.Profession": "Edit Profession",
Expand All @@ -170,9 +172,8 @@
"WW.Item.Delete.MasterPath": "Remove Master Path",

"WW.Item.Delete.Dialog.Title": "Delete Item",
"WW.Item.Delete.Dialog.Msg": "You are about to delete",
"WW.Item.Delete.Dialog.Msg2": "This action is irreversible.",
"WW.Item.Delete.Dialog.Confirm": "Are you sure you want to delete",
"WW.Item.Delete.Dialog.Msg": "You are about to delete {name}. This action is irreversible.",
"WW.Item.Delete.Dialog.Confirm": "Are you sure you want to delete {name}?",

"WW.Item.Uses.TalentSpend": "Spend use/token",
"WW.Item.Uses.TalentRecover": "Recover use/token",
Expand Down
10 changes: 5 additions & 5 deletions module/dice/roll-attribute.mjs
Expand Up @@ -29,7 +29,7 @@ export default class RollAttribute extends FormApplication {
// Assign label, name, etc
this.label = obj.label;
this.content = obj.content;
this.name = attKey == 'luck' ? 'Luck' : this.system.attributes[attKey].label;
this.name = attKey == 'luck' ? i18n('WW.Attributes.Luck') : this.system.attributes[attKey].label;
this.effectBoonsGlobal = this.system.boons.attributes[attKey].global ?
this.system.boons.attributes[attKey].global : 0;
this.attackBoons = this.system.boons.attacks.global;
Expand Down Expand Up @@ -405,19 +405,19 @@ export default class RollAttribute extends FormApplication {
break;
}
case 'str': {
againstDisplay += i18n('WW.Strength');
againstDisplay += i18n('WW.Attributes.Strength');
break;
}
case 'agi': {
againstDisplay += i18n('WW.Agility');
againstDisplay += i18n('WW.Attributes.Agility');
break;
}
case 'int': {
againstDisplay += i18n('WW.Intellect');
againstDisplay += i18n('WW.Attributes.Intellect');
break;
}
case 'wil': {
againstDisplay += i18n('WW.Will');
againstDisplay += i18n('WW.Attributes.Will');
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion module/dice/roll-damage.mjs
Expand Up @@ -117,7 +117,7 @@ export default class RollDamage extends FormApplication {
//const finalExp = event.target.querySelector('.damage-expression').innerHTML;

// Prepare apply button.
const labelHtml = i18n('WW.Damage.Of') + ' ' + '<span class="owner-only">' + this.item.name + '</span><span class="non-owner-only">? ? ?</span>';
const labelHtml = i18n('WW.Damage.Of', { name: '<span class="owner-only">' + this.item.name + '</span><span class="non-owner-only">? ? ?</span>' });

const dataset = {
action: 'apply-damage',
Expand Down
4 changes: 2 additions & 2 deletions module/sheets/actor-sheet.mjs
Expand Up @@ -653,7 +653,7 @@ export default class WWActorSheet extends ActorSheet {
async _onItemDelete(item, button) {
const confirm = await Dialog.confirm({
title: i18n('WW.Item.Delete.Dialog.Title'),
content: i18n('WW.Item.Delete.Dialog.Msg') + ' <b>' + item.name + '</b>. ' + i18n('WW.Item.Delete.Dialog.Msg2') + '<p class="dialog-sure">' + i18n('WW.Item.Delete.Dialog.Confirm') + " " + item.name + '?</p>'
content: i18n('WW.Item.Delete.Dialog.Msg', {name: '<b>' + item.name + '</b>'}) + '<p class="dialog-sure">' + i18n('WW.Item.Delete.Dialog.Confirm', {name: item.name}) + '</p>'
});

if (!confirm) return;
Expand Down Expand Up @@ -767,7 +767,7 @@ export default class WWActorSheet extends ActorSheet {

const arrPath = 'system.' + dataset.array,
oldArray = foundry.utils.getProperty(this.document, arrPath),
defaultName = (arrPath.includes('languages') && !oldArray.length) ? i18n('WW.Languages.Common') : i18n('WW.' + dataset.loc + '.New'),
defaultName = (arrPath.includes('languages') && !oldArray.length) ? i18n('WW.Detail.Language.Common') : i18n('WW.Detail.' + dataset.loc + '.New'),
arr = [...oldArray, { name: defaultName }];

// Update document
Expand Down
2 changes: 1 addition & 1 deletion templates/actors/parts/Character-equipment.hbs
Expand Up @@ -37,7 +37,7 @@
<div class="item-image"></div>
<div class="item-name">{{localize "WW.Item.Name"}}</div>
<div class="item-fixed">{{localize "WW.Damage.Label"}}</div>
<div class="item-fixed">{{localize "WW.Weapon.Grip"}}</div>
<div class="item-fixed">{{localize "WW.Weapon.Grip.Label"}}</div>
<div class="item-traits">{{localize "WW.Weapon.Traits.Label"}}</div>
<div class="item-controls">
<a class="item-control item-create" title="Create item" data-type="Equipment" data-subtype="weapon"><i
Expand Down
2 changes: 1 addition & 1 deletion templates/actors/parts/NPC-summary.hbs
Expand Up @@ -53,7 +53,7 @@

{{#if system.stats.defense.details}}({{/if}}<input class="auto-resize" type="text"
name="system.stats.defense.details" value="{{system.stats.defense.details}}" data-dtype="String"
title="{{localize " WW.Defense.Details"}}" />{{#if system.stats.defense.details}}){{/if}}
title="{{localize "WW.Defense.Details"}}" />{{#if system.stats.defense.details}}){{/if}}
</div>

{{!-- Health, Damage --}}
Expand Down

0 comments on commit 7e34672

Please sign in to comment.