Skip to content

Commit 21141fe

Browse files
committed
feat: mark ui as consistent
1 parent 3e9a086 commit 21141fe

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

app/pages/translate/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
variant: 'link',
4444
to: `/translate/nwp/${term.key}`,
4545
},
46+
{
47+
label: 'Markeer als consistent',
48+
color: 'neutral',
49+
onClick: () => uiStore.markUIConsistent(term.key),
50+
},
4651
]"
4752
/>
4853
</template>

app/stores/ui.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
type State = {
22
consistentNWS: Record<string, string[]>;
3+
consistentUI: string[];
34
nwpString: TranslationFile | undefined;
45
nwpTranslations: ProgramUIFile | undefined;
56
originalsString: TranslationFile;
@@ -15,6 +16,9 @@ export const useUIStore = defineStore("ui", {
1516
[key]: [...(this.consistentNWS[key] || []), otherKey],
1617
};
1718
},
19+
markUIConsistent(key: string) {
20+
this.consistentUI.push(key);
21+
},
1822
},
1923
getters: {
2024
inconsistentNWS(state): {
@@ -87,7 +91,9 @@ export const useUIStore = defineStore("ui", {
8791
},
8892
uiInconsistencies(state): { key: string; nwp: string; nws: string }[] {
8993
return this.nwpKeys
90-
.filter((key) => this.keys.includes(key))
94+
.filter(
95+
(key) => this.keys.includes(key) && !state.consistentUI.includes(key),
96+
)
9197
.map((key) => ({
9298
key,
9399
nwp: state.nwpTranslations?.[key] || "<LEGE VERTALING>",
@@ -99,6 +105,7 @@ export const useUIStore = defineStore("ui", {
99105
persist: true,
100106
state: (): State => ({
101107
consistentNWS: {},
108+
consistentUI: [],
102109
nwpString: undefined,
103110
nwpTranslations: undefined,
104111
originalsString: "",

0 commit comments

Comments
 (0)