diff --git a/src/module/providers/pf2e.js b/src/module/providers/pf2e.js index 62d4118..ace658a 100644 --- a/src/module/providers/pf2e.js +++ b/src/module/providers/pf2e.js @@ -214,4 +214,23 @@ export default class pf2eLanguageProvider extends LanguageProvider { } return filtered; } + + getUserLanguages(actor) { + let knownLanguages = new Set(); + let literateLanguages = new Set(); + if (actor.system?.traits?.languages) { + for (let lang of actor.system.traits.languages.value) { + if (lang in CONFIG.PF2E.languages) { + knownLanguages.add(lang); + } + } + if (actor.system.traits.languages.custom) { + for (let lang of actor.system.traits.languages.custom.split(/[,;]/)) { + const key = lang.trim().toLowerCase(); + knownLanguages.add(key); + } + } + } + return [knownLanguages, literateLanguages]; + } }