Skip to content

Commit

Permalink
Update pf2e.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mclemente committed Oct 25, 2023
1 parent d9ed99c commit 6fc9d20
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/module/providers/pf2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

0 comments on commit 6fc9d20

Please sign in to comment.