From f22148ceff3beff66d0acac673082e2aaf89d8d4 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Fri, 25 Apr 2025 22:17:37 +0200 Subject: [PATCH] (grammar) allow empty cells in grammar table --- components/GrammarTable.vue | 9 +++-- locale/gl/config.suml | 41 +++++++++++++++++++++++ locale/gl/pronouns/GrammarTables.vue | 50 ---------------------------- src/language/grammarTables.ts | 4 +-- 4 files changed, 50 insertions(+), 54 deletions(-) delete mode 100644 locale/gl/pronouns/GrammarTables.vue diff --git a/components/GrammarTable.vue b/components/GrammarTable.vue index 81722302f..e4d76e117 100644 --- a/components/GrammarTable.vue +++ b/components/GrammarTable.vue @@ -16,6 +16,9 @@ const expandVariantsForSection = (sectionVariants: SectionDefinition['variants'] if (Array.isArray(sectionVariants)) { return sectionVariants.map((sectionVariant) => { const morphemeCells = sectionVariant.morphemeCells.map((morphemeCell) => { + if (morphemeCell === null) { + return null; + } if (typeof morphemeCell === 'string') { return { morpheme: morphemeCell }; } @@ -43,7 +46,8 @@ const buildVariantsForSection = ( ): Variant[] => { return expandVariantsForSection(sectionVariants).filter((variant) => { return variant.morphemeCells.some((morphemeCell) => { - return props.exampleValues.morphemeValues.getSpelling(morphemeCell.morpheme) !== undefined; + return morphemeCell !== null && + props.exampleValues.morphemeValues.getSpelling(morphemeCell.morpheme) !== undefined; }); }); }; @@ -125,8 +129,9 @@ const rowHeaderCount = computed(() => { - + -
-

- - pronouns.grammarTablequotation.colon -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PronombrePr. de objeto directoArtículo determinadoArtículo indeterminadoFlexión
Singular
Plural
-
-
- - - diff --git a/src/language/grammarTables.ts b/src/language/grammarTables.ts index 06fc47048..da6d6801f 100644 --- a/src/language/grammarTables.ts +++ b/src/language/grammarTables.ts @@ -20,7 +20,7 @@ export interface SectionDefinition { export interface VariantDefinition { name?: string; - morphemeCells: (string | MorphemeCellDefinition)[]; + morphemeCells: (string | MorphemeCellDefinition | null)[]; } export interface VariantsFromBaseDefinition { @@ -41,7 +41,7 @@ export interface Variant { name?: string; numerus?: 'singular' | 'plural'; icon?: string; - morphemeCells: MorphemeCell[]; + morphemeCells: (MorphemeCell | null)[]; } export interface MorphemeCell {