Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more strings + string refinements #449

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/module/actor/sheets/charactersheet-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class IronswornCharacterSheetV2 extends VueActorSheet {
return [
{
class: 'ironsworn-toggle-edit-mode',
label: 'Edit',
label: game.i18n.localize('Edit'),
icon: 'fas fa-edit',
onclick: (e) => this._toggleEditMode(e),
},
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/sheets/foesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class FoeSheet extends VueActorSheet {
return [
{
class: 'ironsworn-toggle-edit-mode',
label: 'Edit',
label: game.i18n.localize('Edit'),
icon: 'fas fa-edit',
onclick: () => {
const item = this.actor.items.find((x) => x.type === 'progress')
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/sheets/sf-charactermovesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class SFCharacterMoveSheet extends VueApplication {
}

get title() {
return `${game.i18n.localize('IRONSWORN.Moves')} — ${this.actor.name}`
return `${game.i18n.localize('IRONSWORN.MOVE.TITLE')} — ${this.actor.name}`
}

async highlightMove(move: IronswornItem) {
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/sheets/sf-charactersheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class StarforgedCharacterSheet extends VueActorSheet {
return [
{
class: 'ironsworn-toggle-edit-mode',
label: 'Edit',
label: game.i18n.localize('Edit'),
icon: 'fas fa-edit',
onclick: (e) => this._toggleEditMode(e),
},
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/sheets/sharedsheet-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class IronswornSharedSheetV2 extends VueActorSheet {
return [
{
class: 'ironsworn-toggle-edit-mode',
label: 'Edit',
label: game.i18n.localize('Edit'),
icon: 'fas fa-edit',
onclick: (e) => this._toggleEditMode(e),
},
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/sheets/sitesheet-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class IronswornSiteSheetV2 extends VueActorSheet {
return [
{
class: 'ironsworn-toggle-edit-mode',
label: 'Edit',
label: game.i18n.localize('Edit'),
icon: 'fas fa-edit',
onclick: (e) => this._toggleEditMode(e),
},
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/sheets/sitesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class IronswornSiteSheet extends ActorSheet<ActorSheet.Options, Data> {
return [
{
class: 'ironsworn-toggle-edit-mode',
label: 'Edit',
label: game.i18n.localize('Edit'),
icon: 'fas fa-edit',
onclick: (e) => this._toggleEditMode(e),
},
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/sheets/starshipsheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class StarshipSheet extends VueActorSheet {
return [
{
class: 'ironsworn-toggle-edit-mode',
label: 'Edit',
label: game.i18n.localize('Edit'),
icon: 'fas fa-edit',
onclick: (e) => this._toggleEditMode(e),
},
Expand Down
21 changes: 11 additions & 10 deletions src/module/applications/createActorDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>

static get defaultOptions() {
return mergeObject(super.defaultOptions, {
title: game.i18n.localize('IRONSWORN.CreateActor'),
title: game.i18n.format('DOCUMENT.Create', { type: 'DOCUMENT.Actor' }),
template: 'systems/foundry-ironsworn/templates/actor/create.hbs',
id: 'new-actor-dialog',
resizable: false,
Expand Down Expand Up @@ -69,7 +69,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
const drawResult = await table?.draw({ displayChat: false })

this._createWithFolder(
drawResult.results[0]?.data.text || 'Character',
drawResult.results[0]?.data.text || game.i18n.localize('Character'),
'character',
ev.currentTarget.dataset.img || undefined
)
Expand All @@ -78,7 +78,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
async _sharedCreate(ev: JQuery.ClickEvent) {
ev.preventDefault()
this._createWithFolder(
'Shared',
game.i18n.localize('IRONSWORN.DOCUMENT.Shared'),
'shared',
ev.currentTarget.dataset.img || undefined
)
Expand All @@ -87,7 +87,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
async _siteCreate(ev: JQuery.ClickEvent) {
ev.preventDefault()
this._createWithFolder(
'Site',
game.i18n.localize('IRONSWORN.DOCUMENT.DelveSite'),
'site',
ev.currentTarget.dataset.img || undefined
)
Expand All @@ -96,7 +96,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
async _foeCreate(ev: JQuery.ClickEvent) {
ev.preventDefault()
this._createWithFolder(
'NPC',
game.i18n.localize('IRONSWORN.DOCUMENT.Encounter'),
'foe',
ev.currentTarget.dataset.img || undefined
)
Expand All @@ -105,11 +105,11 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
async _sfcharacterCreate(ev: JQuery.ClickEvent) {
ev.preventDefault()

// Roll an Ironlander name
// Roll a Starforged name
const name = await this._randomStarforgedName()

this._createWithFolder(
name || 'Character',
name || game.i18n.localize('Character'),
'character',
ev.currentTarget.dataset.img || undefined,
'ironsworn.StarforgedCharacterSheet'
Expand All @@ -119,7 +119,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
async _sfshipCreate(ev: JQuery.ClickEvent) {
ev.preventDefault()
this._createWithFolder(
'Starship',
game.i18n.localize('IRONSWORN.DOCUMENT.Starship'),
'starship',
ev.currentTarget.dataset.img || undefined
)
Expand All @@ -128,7 +128,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
async _sfLocationCreate(ev: JQuery.ClickEvent) {
ev.preventDefault()
this._createWithFolder(
'Location',
game.i18n.localize('IRONSWORN.DOCUMENT.Location'),
'location',
ev.currentTarget.dataset.img || undefined
)
Expand Down Expand Up @@ -160,6 +160,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>

async _ironlanderNameTable(): Promise<RollTable | undefined> {
const table = game.tables?.find(
// TODO: consider including the delve "Namesake" table (which the text suggests for use in addition to the ironlander names table)
(x) => x.name === 'Oracle: Ironlander Names'
)
if (table) return table
Expand All @@ -176,7 +177,7 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
async _randomStarforgedName(): Promise<string | undefined> {
const pack = game.packs.get('foundry-ironsworn.starforgedoracles')
if (!pack) return undefined

// TODO: SF notes that given names can often be usd as family names and vice versa, so we could potentially randomize which table is used to offer a greater variety of results
const firstTable = (await getFoundryTableByDfId(
'Starforged/Oracles/Characters/Name/Given_Name'
)) as any
Expand Down
2 changes: 1 addition & 1 deletion src/module/applications/firstStartDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class FirstStartDialog extends FormApplication<FormApplicationOptions> {

static get defaultOptions(): FormApplicationOptions {
return mergeObject(super.defaultOptions, {
title: game.i18n.localize('IRONSWORN.First Start.Welcome'),
title: game.i18n.localize('IRONSWORN.FIRST_START.Welcome'),
template: 'systems/foundry-ironsworn/templates/first-start.hbs',
id: 'first-start-dialog',
resizable: false,
Expand Down
2 changes: 1 addition & 1 deletion src/module/applications/sf/editSectorApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class EditSectorDialog extends VueApplication {

static get defaultOptions(): ApplicationOptions {
return mergeObject(super.defaultOptions, {
title: game.i18n.localize('IRONSWORN.Sector'),
title: game.i18n.localize('IRONSWORN.DOCUMENT.Sector'),
template: 'systems/foundry-ironsworn/templates/edit-sector.hbs',
id: 'edit-sector-dialog',
resizable: true,
Expand Down
2 changes: 1 addition & 1 deletion src/module/applications/sfSettingTruthsDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class SFSettingTruthsDialog extends FormApplication<FormApplicationOption
console.log(sections)

// const journal = await JournalEntry.create({
// name: game.i18n.localize('IRONSWORN.YourWorldTruths'),
// name: game.i18n.localize('IRONSWORN.TRUTHS.JOURNAL.STARFORGED.Title'),
// content: sections.join('\n'),
// })
// journal?.sheet?.render(true)
Expand Down
4 changes: 2 additions & 2 deletions src/module/applications/worldTruthsDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class WorldTruthsDialog extends FormApplication<FormApplicationOptions> {

static get defaultOptions() {
return mergeObject(super.defaultOptions, {
title: game.i18n.localize('IRONSWORN.YourWorldTruths'),
title: game.i18n.localize('IRONSWORN.TRUTHS.TITLE.Classic'),
template: 'systems/foundry-ironsworn/templates/truths.hbs',
id: 'world-truths-dialog',
resizable: true,
Expand Down Expand Up @@ -81,7 +81,7 @@ export class WorldTruthsDialog extends FormApplication<FormApplicationOptions> {
}

const journal = await JournalEntry.create({
name: game.i18n.localize('IRONSWORN.YourWorldTruths'),
name: game.i18n.localize('IRONSWORN.TRUTHS.TITLE.Classic'),
content: sections.join('\n'),
})
journal?.sheet?.render(true)
Expand Down
12 changes: 9 additions & 3 deletions src/module/chat/cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ export class IronswornChatCard {
parent.find('.move-outcome').addClass('strikethru')
parent.find('.move-outcome button').prop('disabled', true)
parent.find('.momentum-burn').html(`
<h3>${game.i18n.localize('IRONSWORN.MomentumBurnt')}</h3>
<h3>${game.i18n.localize(
'IRONSWORN.MOMENTUM.BURN.OutcomeReplacementReason'
)}</h3>
${result || ''}
${bonusContent || ''}
`)
Expand Down Expand Up @@ -173,7 +175,9 @@ export class IronswornChatCard {
parent.find('.move-outcome').addClass('strikethru')
parent.find('.move-outcome button').prop('disabled', true)
parent.find('.momentum-burn').html(`
<h3>${game.i18n.localize('IRONSWORN.MomentumBurnt')}</h3>
<h3>${game.i18n.localize(
'IRONSWORN.MOMENTUM.BURN.OutcomeReplacementReason'
)}</h3>
<strong>${hittypetext}:</strong>
${IronswornHandlebarsHelpers.enrichMarkdown(newOutcome)}
`)
Expand Down Expand Up @@ -250,7 +254,9 @@ export class IronswornChatCard {
const move = await moveDataByName('Sojourn')
if (!move) return

move.Name = `${move.Name} – ${game.i18n.localize('IRONSWORN.Focus')}`
move.Name = `${move.Name} – ${game.i18n.localize(
'IRONSWORN.SOJOURN.Focus'
)}`
move.Description = move.ExtraDescription || ''
move.Strong = move.ExtraStrong || ''
move.Weak = move.ExtraWeak || ''
Expand Down
14 changes: 8 additions & 6 deletions src/module/chat/chatrollhelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { IronswornItem } from '../item/item'
import { FeatureOrDanger, SFMoveDataProperties } from '../item/itemtypes'
import {
computeRollOutcome,
computeOutcomeText,
computeOutcomeLabel,
} from '../rolls/chat-message.js'
import {
ACTION_DIE_SIDES,
Expand Down Expand Up @@ -135,10 +135,12 @@ function calculateCardTitle(params: RollMessageParams) {
}

if (params.subtitle) {
return `${game.i18n.localize('IRONSWORN.ProgressRoll')}: ${params.subtitle}`
return `${game.i18n.localize('IRONSWORN.PROGRESS.ProgressRoll')}: ${
params.subtitle
}`
}

const rollText = game.i18n.localize('IRONSWORN.Roll')
const rollText = game.i18n.localize('IRONSWORN.ROLL.Label')
if (params.stat) {
const statText = game.i18n.localize(`IRONSWORN.${capitalize(params.stat)}`)
return `${rollText} +${statText}`
Expand Down Expand Up @@ -212,7 +214,7 @@ function calculateMomentumProps(
challengeDie1,
challengeDie2
)
const momentumHitTypeI18n = computeOutcomeText(momentumHitType, match)
const momentumHitTypeI18n = computeOutcomeLabel(momentumHitType, match)

if (momentumHitType > rawOutcome)
return {
Expand Down Expand Up @@ -262,7 +264,7 @@ export async function createIronswornChatRoll(params: RollMessageParams) {
themeClass: `theme-${IronswornSettings.theme}`,
action,
actionCapped,
hitType: computeOutcomeText(hitType, match),
hitType: computeOutcomeLabel(hitType, match),
title: calculateCardTitle(params),
resultText: calculateMoveResultText(hitType, params.move),
bonusContent,
Expand Down Expand Up @@ -334,7 +336,7 @@ export async function createStarforgedMoveRollChat(
themeClass: `theme-${IronswornSettings.theme}`,
action,
actionCapped,
hitType: computeOutcomeText(hitType, match),
hitType: computeOutcomeLabel(hitType, match),
title: calculateSFCardTitle(params),
resultText: calculateSFMoveResultText(hitType, match, params.move),
nextOracles: await sfNextOracles(params.move),
Expand Down
17 changes: 12 additions & 5 deletions src/module/chat/movecontentcallbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,39 @@ export const MoveContentCallbacks: { [key: string]: Callback } = {
hitType === RollOutcome.Weak_hit
? ` <button class="ironsworn__delvedepths__roll" data-stat="${stat}">
<i class="fa fa-dice-d6"></i> ${game.i18n.localize(
'IRONSWORN.Roll'
'IRONSWORN.ROLL.Label'
)}
</button>`
: undefined,

'Reveal a Danger': ({ site }: CallbackInput) => `
<button class="ironsworn__revealdanger__roll" data-site="${site?.id}">
<i class="fa fa-dice-d6"></i> ${game.i18n.localize('IRONSWORN.Roll')}
<i class="fa fa-dice-d6"></i> ${game.i18n.localize(
'IRONSWORN.ROLL.Label'
)}
</button>
`,

Sojourn: ({ hitType }: CallbackInput) =>
hitType === RollOutcome.Miss
? undefined
: `
: // TODO: point this to the text of the move object instead
`
<hr>
<p>${game.i18n.localize(
'IRONSWORN.MoveContents.Sojourn.extradescription'
)}</p>
<button class="ironsworn__sojourn__extra__roll">
<i class="fa fa-dice-d6"></i> ${game.i18n.localize('IRONSWORN.Roll')}
<i class="fa fa-dice-d6"></i> ${game.i18n.localize(
'IRONSWORN.ROLL.Label'
)}
</button>
`,

'Pay the Price': () =>
`<button class="ironsworn__paytheprice__roll">
<i class="fa fa-dice-d6"></i> ${game.i18n.localize('IRONSWORN.Roll')}
<i class="fa fa-dice-d6"></i> ${game.i18n.localize(
'IRONSWORN.ROLL.Label'
)}
</button>`,
}
10 changes: 5 additions & 5 deletions src/module/constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const RANKS = {
troublesome: 'IRONSWORN.Troublesome',
dangerous: 'IRONSWORN.Dangerous',
formidable: 'IRONSWORN.Formidable',
extreme: 'IRONSWORN.Extreme',
epic: 'IRONSWORN.Epic',
troublesome: 'IRONSWORN.PROGRESS.CHALLENGE_RANK.1',
dangerous: 'IRONSWORN.PROGRESS.CHALLENGE_RANK.2',
formidable: 'IRONSWORN.PROGRESS.CHALLENGE_RANK.3',
extreme: 'IRONSWORN.PROGRESS.CHALLENGE_RANK.4',
epic: 'IRONSWORN.PROGRESS.CHALLENGE_RANK.5',
}

export const RANK_INCREMENTS = {
Expand Down
Loading