diff --git a/locale/en/config.suml b/locale/en/config.suml index b3a3243e5..5af2c3578 100644 --- a/locale/en/config.suml +++ b/locale/en/config.suml @@ -34,6 +34,7 @@ pronouns: reflexive: '#self' examples: ['💫', '💙'] template: 'Open one of the examples and simply replace the emoji in the URL with your own.' + slashes: true avoiding: false others: 'Other pronouns' diff --git a/src/buildPronoun.js b/src/buildPronoun.js index 119524921..dfc525cd1 100644 --- a/src/buildPronoun.js +++ b/src/buildPronoun.js @@ -51,6 +51,27 @@ export const buildPronoun = (pronouns, path) => { pronoun = buildPronounFromTemplate(path.substring(1), process.env.CONFIG.pronouns.null); } + const p = path.split('/').filter(s => !!s); + if (!pronoun && process.env.CONFIG.pronouns.slashes !== false && p.length === MORPHEMES.length) { + pronoun = new Pronoun( + `${p[0]}/${p[1]}`, + '', + false, + buildDict(function*() { + let i = 0; + for (let m of MORPHEMES) { + yield [m, p[i++]]; + } + }), + [ p[p.length - 1].endsWith('selves') ], // TODO English specific, extract somewhere + [ false ], + [], + [], + null, + false, + ) + } + return pronoun; }