mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(pronouns) display pronunciation speaker on morphemes in grammar table
This commit is contained in:
parent
eb916934f5
commit
60b788bf3c
@ -7,11 +7,9 @@
|
||||
<small v-if="link">
|
||||
(<nuxt-link :to="'/' + pronoun.canonicalName"><Spelling escape :text="pronoun.canonicalName"/></nuxt-link>)
|
||||
</small>
|
||||
<template v-if="config.pronunciation.enabled && pronunciation && pronoun.pronounceable && example.toPronunciationString(pronoun)">
|
||||
<PronunciationSpeaker v-for="voice in voices" :key="voice"
|
||||
:pronunciation="example.toPronunciationString(pronoun)" :voice="voice"
|
||||
/>
|
||||
</template>
|
||||
<Pronunciation v-if="pronunciation && pronoun.pronounceable && example.toPronunciationString(pronoun)"
|
||||
:pronunciation="example.toPronunciationString(pronoun)"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@ -24,10 +22,5 @@
|
||||
link: { type: Boolean },
|
||||
pronunciation: { type: Boolean },
|
||||
},
|
||||
computed: {
|
||||
voices() {
|
||||
return Object.keys(this.config.pronunciation.voices);
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<span v-if="pronoun.getMorpheme(morpheme, counter)">
|
||||
<Morpheme :pronoun="pronoun" :morpheme="morpheme" :counter="counter" :prepend="prepend" :append="append"/>
|
||||
<span v-if="config.pronunciation.enabled && pronoun.pronounceable && pronoun.getPronunciation(morpheme, counter) && !pronoun.getPronunciation(morpheme, counter).startsWith('=')" class="text-muted">
|
||||
/{{prependPr}}{{pronoun.getPronunciation(morpheme, counter)}}{{appendPr}}/
|
||||
</span>
|
||||
<Pronunciation v-if="pronoun.pronounceable && pronoun.getPronunciation(morpheme, counter) && !pronoun.getPronunciation(morpheme, counter).startsWith('=')"
|
||||
:pronunciation="`/${prependPr}${pronoun.getPronunciation(morpheme, counter)}${appendPr}/`" text
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
|
28
components/Pronunciation.vue
Normal file
28
components/Pronunciation.vue
Normal file
@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<span>
|
||||
<span v-if="text" class="text-muted">
|
||||
{{ pronunciation }}
|
||||
</span>
|
||||
<PronunciationSpeaker v-for="voice in voices" :key="voice"
|
||||
:pronunciation="pronunciation" :voice="voice"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
pronunciation: { required: true, type: String },
|
||||
text: { default: false, type: Boolean },
|
||||
},
|
||||
computed: {
|
||||
voices() {
|
||||
if (this.config.pronunciation.enabled) {
|
||||
return Object.keys(this.config.pronunciation.voices);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user