From 999b0a320bac3d1873df0894cb57825651adb6e2 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Sat, 11 Feb 2023 15:41:45 +0100 Subject: [PATCH] =?UTF-8?q?[pl][pronouns]=20add=20unaccented=20and=20prep?= =?UTF-8?q?=20=E2=80=93=20BC=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/buildPronoun.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/buildPronoun.js b/src/buildPronoun.js index 7e91e21f0..a0a46d178 100644 --- a/src/buildPronoun.js +++ b/src/buildPronoun.js @@ -67,23 +67,21 @@ export const buildPronoun = (pronouns, path) => { base = base.merge(pronounsWithAliases[option]) } } - if (base) { - base = base.toArray(); - } + let baseArray = base ? base.toArray() : null; // i know, it's ugly… didn't think about BC much and now it's a huge mess… const pronounStrLen = pronounStr.map(x => x.startsWith('!') ? parseInt(x.substring(1)) : 1).reduce((c, a) => c + a, 0); - if (config.locale === 'pl' && base && pronounStrLen < 30) { - base = [ - ...base.slice(0, 4), - base[5], - base[8], - ...base.slice(11) + if (config.locale === 'pl' && baseArray && pronounStrLen < 30) { + baseArray = [ + ...baseArray.slice(0, 4), + baseArray[5], + baseArray[8], + ...baseArray.slice(11) ]; } let pronoun = pronounStr.length === 1 ? base - : Pronoun.from(Compressor.uncompress(pronounStr, base, config.locale)); + : Pronoun.from(Compressor.uncompress(pronounStr, baseArray, config.locale)); if (!config) { return pronoun;