poe-i18n
Version:
i18n utility for Path of Exile
15 lines (11 loc) • 393 B
text/typescript
const default_gender = 'N';
const default_plural = 'S';
export default function inflectionIdentifier(context: { inflection?: string }) {
const { inflection } = context;
let gender: string | undefined;
let plural: string | undefined;
if (inflection != null) {
[gender, plural] = inflection.split('');
}
return [gender || default_gender, plural || default_plural].join('');
}