applyPersonalisation

This works with the characterReplacer, fontReplacer and genderReplacer to personalise the manuscript.

Characters

Name

{name-0} outputs the name of the first child, which can be altered depending on the index needed.

Gender

Set up a file in the locale-specific copy folder called gender-alternates.js

module.exports = { him: { boy: 'him', girl: 'her', } };

Use the placeholder {gender-him-0} where 0 is the index of the character. The him in gender-him-0 must match the key in the genderAlternates object (not the gender value itself). This will output the correct value, depending on the dynamic customisation.

This approach will work with gendered adjectives in different languages also. Localised keys can be used in the translations as long as the placeholder matches.

Fonts

{font-italic}word{font-end} in the manuscript file results in <span class="italic">word</span>

Any rules for the corresponding class should then be defined in the CSS.