[pl][nouns] abbreviations

This commit is contained in:
Andrea 2022-02-13 15:20:14 +01:00
parent 8eb89b623d
commit 771e545e29
23 changed files with 87 additions and 5 deletions

View File

@ -0,0 +1,40 @@
<template>
<span>
<abbr v-if="abbr" :title="meaning">{{abbr}}</abbr><template v-if="abbr">&nbsp;</template><slot v-bind:abbr="abbr" v-bind:meaning="meaning" v-bind:word="word"></slot>
</span>
</template>
<script>
import { abbreviations } from '../src/data';
export default {
props: {
v: {required: true},
},
data() {
for (let abbr in abbreviations) {
if (!abbreviations.hasOwnProperty(abbr)) { continue; }
if (this.v.startsWith(abbr + ' ')) {
return {
abbr,
meaning: abbreviations[abbr],
word: this.v.substring(abbr.length + 1),
};
}
}
return {
abbr: null,
meaning: null,
word: this.v,
}
},
}
</script>
<style lang="scss" scoped>
@import "assets/variables";
abbr {
text-decoration-color: $text-muted;
}
</style>

View File

@ -2,14 +2,18 @@
<div>
<ul class="list-singular">
<li v-for="w in noun[gender]">
<Declension v-if="gender === 'neutr' && config.nouns.declension" :word="w" tooltip/>
<Spelling v-else :text="w"/>
<Abbreviation :v="w" v-slot="{word}">
<Declension v-if="gender === 'neutr' && config.nouns.declension" :word="word" tooltip/>
<Spelling v-else :text="word"/>
</Abbreviation>
</li>
</ul>
<ul v-if="config.nouns.plurals" class="list-plural">
<li v-for="w in noun[gender + 'Pl']">
<Declension v-if="gender === 'neutr' && config.nouns.declension" :word="w" plural :singularOptions="noun.neutr" tooltip/>
<Spelling v-else :text="w"/>
<Abbreviation :v="w" v-slot="{word}">
<Declension v-if="gender === 'neutr' && config.nouns.declension" :word="word" plural :singularOptions="noun.neutr" tooltip/>
<Spelling v-else :text="word"/>
</Abbreviation>
</li>
</ul>
</div>

View File

@ -115,6 +115,11 @@
</template>
</button>
<p class="small text-muted mt-1"><T>nouns.submit.moderation</T></p>
<ul v-if="Object.keys(abbreviations).length > 0" class="small text-muted">
<li v-for="(meaning, abbr) in abbreviations">
{{abbr}} {{meaning}}
</li>
</ul>
</form>
</section>
<section v-else class="text-center">
@ -125,7 +130,7 @@
</template>
<script>
import { nounTemplates } from '../src/data';
import { nounTemplates, abbreviations } from '../src/data';
export default {
data() {
@ -145,6 +150,7 @@
templates: nounTemplates,
templateBase: '',
templateVisible: false,
abbreviations,
}
},
methods: {

1
locale/_/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/de/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/en/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/eo/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/es/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/fr/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/gl/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/it/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/ja/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/nl/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/no/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

7
locale/pl/nouns/abbr.tsv Normal file
View File

@ -0,0 +1,7 @@
abbreviation meaning
zbior. formy zbiorowe
met. metonimia
duk. dukaizm/dukatyw
zdrob. zdrobniałe
mn. mnogie (w liczbie pojedynczej)
skr. skrót
1 abbreviation meaning
2 zbior. formy zbiorowe
3 met. metonimia
4 duk. dukaizm/dukatyw
5 zdrob. zdrobniałe
6 mn. mnogie (w liczbie pojedynczej)
7 skr. skrót

1
locale/pt/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/ru/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/sv/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/yi/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

1
locale/zh/nouns/abbr.tsv Normal file
View File

@ -0,0 +1 @@
abbreviation meaning
1 abbreviation meaning

View File

@ -62,3 +62,10 @@ export const nounDeclensionTemplates = buildList(function* () {
yield new NounDeclension(d);
}
});
import abbreviationsRaw from '../data/nouns/abbr.tsv';
export const abbreviations = buildDict(function* () {
for (let a of abbreviationsRaw) {
yield [a.abbreviation, a.meaning];
}
});