-
Notifications
You must be signed in to change notification settings - Fork 0
getPronouns
Jason Godesky edited this page Jul 26, 2026
·
1 revision
getPronouns assumes that you have a section like this in your internationalization file:
common-foundryvtt-example:
pronouns:
fem:
sub: she
obj: her
self: herself
pos:
adj: her
pro: hers
masc:
sub: he
obj: him
self: himself
pos:
adj: his
pro: hisThis method returns an object with all of the localized versions for one set of pronouns for a given grammatical gender, so you can pass it as data to another localization string, like this:
common-foundryvtt-example:
example: {S} took it all for {self}.The path to the pronouns section in your localization file. In the example above, it would be common-foundryvtt-example.
The grammatical gender you want to retrieve pronouns for. The example above uses fem and masc as recognizable, English-language examples to illustrate the various grammatical forms needed, but you can define as many and whatever genders you like in your localization file.
An object with the following shape:
export interface Pronouns {
s: string // Subjective
S: string // Subjective (capitalized)
o: string // Objective
O: string // Objective (capitalized)
self: string // himself/herself
Self: string // Himself/Herself (capitalized)
pa: string // Possessive adjective
PA: string // Possessive adjective (capitalized)
pp: string // Possessive pronoun
PP: string // Possessive pronoun (capitalized)
}import { getPronouns } from '@revolutionarygamesco/common-foundryvtt'
const pronouns = getPronouns('common-foundryvtt-example', 'fem')
game.i18n.localize('common-foundryvtt-example.example', { ...pronouns }) // She took it all for herself.