Skip to content

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: his

This 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}.

Parameters

path: string

The path to the pronouns section in your localization file. In the example above, it would be common-foundryvtt-example.

gender: string

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.

Returns

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)
}

Examples

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.

Clone this wiki locally