benwebber / tiddlywiki-dnd

Manage D&D campaigns with TiddlyWiki
https://benwebber.github.io/tiddlywiki-dnd/
MIT License
35 stars 8 forks source link

Localize creature and spell descriptions #4

Open benwebber opened 5 years ago

benwebber commented 5 years ago

Consider a tiddler with the following fields:

Field Value
dnd.creature.size medium
dnd.creature.type humanoid
dnd.creature.tags orc
dnd.creature.alignment chaotic evil

According to the convention in the English material, we should render the description like:

Medium humanoid (orc), chaotic evil

Different languages have different conventions:

Humanoïde (orque) de taille M, chaotique mauvais

We need language-specific template strings to interpolate the field values, translating them where necessary. If a field is missing or empty, it should not appear in the description. For example, if a creature has no tags, we should render:

Medium beast, unaligned

Instead of:

Medium beast (), unaligned

We would use the same system for spell and item descriptions.