(style) unified styling for example buttons and tooltips for accessibility

This commit is contained in:
Valentyne Stigloher 2024-04-30 22:05:36 +02:00
parent a80dc8ca32
commit 7eb1a88faf
33 changed files with 106 additions and 49 deletions

View File

@ -21,7 +21,8 @@ body[data-theme="dark"] {
/* BUTTONS */ /* BUTTONS */
.btn-link { color: #fff; } .btn-link { color: $primary-dark; }
.btn-link:hover { color: lighten($primary-dark, 10%); }
.btn-close { filter: invert(1) grayscale(100%) brightness(200%); } .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.btn-dark { color: #000; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-dark { color: #000; background-color: #f8f9fa; border-color: #f8f9fa; }
.btn-dark:hover { color: #000; background-color: #f9fafb; border-color: #f9fafb; } .btn-dark:hover { color: #000; background-color: #f9fafb; border-color: #f9fafb; }

View File

@ -1,14 +1,16 @@
<template> <template>
<li v-if="pronoun"> <li v-if="pronoun">
<Example :example="example" :pronoun="pronoun" :counter="counter" :link="link" :pronunciation="pronunciation" /> <Example :example="example" :pronoun="pronoun" :counter="counter" :link="link" :pronunciation="pronunciation" />
<button <Tooltip :text="tooltipText">
v-if="hasDifferentExample" <button
type="button" v-if="hasDifferentExample"
class="btn btn-sm btn-link p-1" type="button"
@click="selectDifferentExample()" class="btn btn-sm btn-link p-1"
> @click="selectDifferentExample()"
<Icon v="random" /> >
</button> <Icon v="random" />
</button>
</Tooltip>
</li> </li>
</template> </template>
@ -42,6 +44,12 @@ export default Vue.extend({
hasDifferentExample(): boolean { hasDifferentExample(): boolean {
return this.pronounsChoice.length > 1 || this.suitableExamples.length > 1; return this.pronounsChoice.length > 1 || this.suitableExamples.length > 1;
}, },
tooltipText(): string {
if (this.exampleCategory.name) {
return this.$t('pronouns.examples.shuffleNamed', { category: this.exampleCategory.name });
}
return this.$t('pronouns.examples.shuffle');
},
}, },
created() { created() {
this.selectPronounForExample(false); this.selectPronounForExample(false);

View File

@ -1,13 +1,15 @@
<template> <template>
<a <Tooltip :text="$t('pronunciation.play')">
:class="['mr-2', !pronunciation ? 'disabled' : '']" <a
dir="ltr" :class="['btn', 'btn-sm', 'btn-link', 'p-1', !pronunciation ? 'disabled' : '']"
:href="pronunciationLink" dir="ltr"
target="_blank" :href="pronunciationLink"
@click.prevent="pronounce" target="_blank"
> @click.prevent="pronounce"
<Icon :v="icon" /><sub v-if="name">{{ name }}</sub> >
</a> <Icon :v="icon" /><sub v-if="name">{{ name }}</sub>
</a>
</Tooltip>
</template> </template>

View File

@ -63,7 +63,10 @@ home:
pronouns: pronouns:
header: 'Pronouns' header: 'Pronouns'
headerLong: 'Pronouns' headerLong: 'Pronouns'
examples: 'Example usage in sentences' examples:
header: 'Example usage in sentences'
shuffle: 'Show different example'
shuffleNamed: 'Show different example for %category%'
plural: 'Plural' plural: 'Plural'
intro: 'My pronouns are' intro: 'My pronouns are'
normative: 'Normative' normative: 'Normative'
@ -91,6 +94,9 @@ pronouns:
or: 'or' or: 'or'
grammarTable: 'Table' grammarTable: 'Table'
pronunciation:
play: 'Play audio sample'
sources: sources:
header: 'Sources' header: 'Sources'
headerLong: 'Examples from cultural texts' headerLong: 'Examples from cultural texts'

View File

@ -58,7 +58,8 @@ home:
pronouns: pronouns:
header: 'الضمائر' header: 'الضمائر'
headerLong: 'الضمائر' headerLong: 'الضمائر'
examples: 'تُستعمل في الجمل كالآتي' examples:
header: 'تُستعمل في الجمل كالآتي'
plural: 'صيغة الجمع' plural: 'صيغة الجمع'
intro: 'ضمائري هي' intro: 'ضمائري هي'
normative: 'المعياريه ' normative: 'المعياريه '

View File

@ -61,7 +61,10 @@ home:
pronouns: pronouns:
header: 'Pronomen' header: 'Pronomen'
headerLong: 'Pronomen' headerLong: 'Pronomen'
examples: 'Beispielsätze' examples:
header: 'Beispielsätze'
shuffle: 'Anderen Beispielsatz anzeigen'
shuffleNamed: 'Anderen Beispielsatz für %category% anzeigen'
plural: 'Plural' plural: 'Plural'
intro: 'Meine Pronomen sind' intro: 'Meine Pronomen sind'
normative: 'Normativ' normative: 'Normativ'
@ -94,6 +97,9 @@ pronouns:
or: 'oder' or: 'oder'
grammarTable: 'Tabelle' grammarTable: 'Tabelle'
pronunciation:
play: 'Hörbeispiel abspielen'
sources: sources:
header: 'Quellen' header: 'Quellen'
headerLong: 'Beispiele aus Kulturtexten' headerLong: 'Beispiele aus Kulturtexten'

View File

@ -63,7 +63,10 @@ home:
pronouns: pronouns:
header: 'Pronouns' header: 'Pronouns'
headerLong: 'Pronouns' headerLong: 'Pronouns'
examples: 'Example usage in sentences' examples:
header: 'Example usage in sentences'
shuffle: 'Show different example'
shuffleNamed: 'Show different example for %category%'
plural: 'Plural' plural: 'Plural'
intro: 'My pronouns are' intro: 'My pronouns are'
normative: 'Normative' normative: 'Normative'
@ -89,6 +92,9 @@ pronouns:
sentence: > sentence: >
You can modify the default links so that the URL reads like a sentence; for example: You can modify the default links so that the URL reads like a sentence; for example:
pronunciation:
play: 'Play audio sample'
sources: sources:
header: 'Sources' header: 'Sources'
headerLong: 'Examples from cultural texts' headerLong: 'Examples from cultural texts'

View File

@ -50,7 +50,8 @@ home:
pronouns: pronouns:
header: 'Pronomoj' header: 'Pronomoj'
headerLong: 'Pronomoj' headerLong: 'Pronomoj'
examples: 'Ekzempla uzado en frazoj' examples:
header: 'Ekzempla uzado en frazoj'
plural: 'Pluralo' plural: 'Pluralo'
intro: 'Miaj pronomoj estas' intro: 'Miaj pronomoj estas'
normative: 'Norma' normative: 'Norma'

View File

@ -61,7 +61,8 @@ home:
pronouns: pronouns:
header: 'Pronombres' header: 'Pronombres'
headerLong: 'Pronombres' headerLong: 'Pronombres'
examples: 'Ejemplos de uso en oraciones' examples:
header: 'Ejemplos de uso en oraciones'
plural: 'Plural' plural: 'Plural'
intro: 'Mis pronombres son' intro: 'Mis pronombres son'
normative: 'Normativo' normative: 'Normativo'

View File

@ -56,7 +56,8 @@ home:
pronouns: pronouns:
header: 'Asesõnad' header: 'Asesõnad'
headerLong: 'Asesõnad' headerLong: 'Asesõnad'
examples: 'Kasutuse näide lausetes' examples:
header: 'Kasutuse näide lausetes'
plural: 'Mitmus' plural: 'Mitmus'
intro: 'Minu asesõnad on' intro: 'Minu asesõnad on'
normative: 'Normatiivne' normative: 'Normatiivne'

View File

@ -58,7 +58,8 @@ home:
pronouns: pronouns:
header: 'Pronoms' header: 'Pronoms'
headerLong: 'Pronoms' headerLong: 'Pronoms'
examples: 'Exemple dusage dans des phrases' examples:
header: 'Exemple dusage dans des phrases'
plural: 'Pluriel' plural: 'Pluriel'
intro: 'Mes pronoms sont' intro: 'Mes pronoms sont'
normative: 'Normatif' normative: 'Normatif'

View File

@ -60,7 +60,8 @@ home:
pronouns: pronouns:
header: 'Pronomes' header: 'Pronomes'
headerLong: 'Pronomes' headerLong: 'Pronomes'
examples: 'Exemplos de uso em frases' examples:
header: 'Exemplos de uso em frases'
plural: 'Plural' plural: 'Plural'
intro: 'Meus pronomes são' intro: 'Meus pronomes são'
normative: 'Normativo' normative: 'Normativo'

View File

@ -62,7 +62,8 @@ home:
pronouns: pronouns:
header: 'Pronouns' header: 'Pronouns'
headerLong: 'Pronouns' headerLong: 'Pronouns'
examples: 'Example usage in sentences' examples:
header: 'Example usage in sentences'
plural: 'Plural' plural: 'Plural'
intro: 'My pronouns are' intro: 'My pronouns are'
normative: 'Normative' normative: 'Normative'

View File

@ -60,7 +60,8 @@ home:
pronouns: pronouns:
header: 'Pronomi' header: 'Pronomi'
headerLong: 'Pronomi' headerLong: 'Pronomi'
examples: 'Esempi pratici di utilizzo' examples:
header: 'Esempi pratici di utilizzo'
plural: 'Plurale' plural: 'Plurale'
intro: 'I miei pronomi sono' intro: 'I miei pronomi sono'
normative: 'Normative' normative: 'Normative'

View File

@ -44,7 +44,8 @@ home:
pronouns: pronouns:
header: '三人称代名詞' header: '三人称代名詞'
headerLong: '三人称代名詞' headerLong: '三人称代名詞'
examples: '文章での使い方の例' examples:
header: '文章での使い方の例'
plural: '複数形' plural: '複数形'
intro: '私の三人称代名詞は' intro: '私の三人称代名詞は'
normative: '規範的' normative: '規範的'

View File

@ -61,7 +61,8 @@ home:
pronouns: pronouns:
header: '대명사' header: '대명사'
headerLong: '대명사' headerLong: '대명사'
examples: '문장안에 예' examples:
header: '문장안에 예'
plural: '복유의' plural: '복유의'
intro: '나의 대명사는' intro: '나의 대명사는'
normative: '규범적' normative: '규범적'

View File

@ -61,7 +61,8 @@ home:
pronouns: pronouns:
header: 'Pronombres' header: 'Pronombres'
headerLong: 'Pronombres' headerLong: 'Pronombres'
examples: 'Enshemplos de uzo en frazas' examples:
header: 'Enshemplos de uzo en frazas'
plural: 'Plural' plural: 'Plural'
intro: 'Mis pronombres son' intro: 'Mis pronombres son'
normative: 'Normativo' normative: 'Normativo'

View File

@ -59,7 +59,8 @@ home:
pronouns: pronouns:
header: 'Voornaamwoorden' header: 'Voornaamwoorden'
headerLong: 'Voornaamwoorden' headerLong: 'Voornaamwoorden'
examples: 'Gebruiksvoorbeelden in zinnen' examples:
header: 'Gebruiksvoorbeelden in zinnen'
plural: 'Meervoud' plural: 'Meervoud'
intro: 'Mijn voornaamwoorden zijn' intro: 'Mijn voornaamwoorden zijn'
normative: 'Normatief' normative: 'Normatief'

View File

@ -53,7 +53,8 @@ home:
pronouns: pronouns:
header: 'Pronomen' header: 'Pronomen'
headerLong: 'Pronomen' headerLong: 'Pronomen'
examples: 'Eksempler i setninger' examples:
header: 'Eksempler i setninger'
plural: 'Flertall' plural: 'Flertall'
intro: 'Mine pronomen er' intro: 'Mine pronomen er'
normative: 'Normativ' normative: 'Normativ'

View File

@ -74,7 +74,8 @@ home:
pronouns: pronouns:
header: 'Zaimki' header: 'Zaimki'
headerLong: 'Niebinarne zaimki<br/> i inne formy' headerLong: 'Niebinarne zaimki<br/> i inne formy'
examples: 'Przykłady użycia w zdaniu' examples:
header: 'Przykłady użycia w zdaniu'
plural: 'Liczba mnoga' plural: 'Liczba mnoga'
intro: 'Moje zaimki to' intro: 'Moje zaimki to'
normative: 'Normatywne' normative: 'Normatywne'
@ -282,7 +283,8 @@ nouns:
Słownik Neutratywów podaje odmianę pasującą do {/ono=„ono/jego”}, Słownik Neutratywów podaje odmianę pasującą do {/ono=„ono/jego”},
lecz możliwa jest też odmiana zgodna z pozostałymi opcjami: lecz możliwa jest też odmiana zgodna z pozostałymi opcjami:
examples: 'Przykłady' examples:
header: 'Przykłady'
dictionary: 'Słownik Neutratywów' dictionary: 'Słownik Neutratywów'
approved: 'wpisów zatwierdzonych' approved: 'wpisów zatwierdzonych'

View File

@ -65,7 +65,8 @@ home:
pronouns: pronouns:
header: 'Pronomes' header: 'Pronomes'
headerLong: 'Pronomes' headerLong: 'Pronomes'
examples: 'Exemplos de uso em frases' examples:
header: 'Exemplos de uso em frases'
plural: 'Plural' plural: 'Plural'
intro: 'Meu conjunto é' intro: 'Meu conjunto é'
normative: 'Normativo' normative: 'Normativo'

View File

@ -61,7 +61,8 @@ home:
pronouns: pronouns:
header: 'Pronume' header: 'Pronume'
headerLong: 'Listă cu pronume' headerLong: 'Listă cu pronume'
examples: 'Utilizarea pronumelor în propoziții' examples:
header: 'Utilizarea pronumelor în propoziții'
plural: 'Plural' plural: 'Plural'
intro: 'Pronumele mele sunt' intro: 'Pronumele mele sunt'
normative: 'Normativ' normative: 'Normativ'

View File

@ -54,7 +54,8 @@ home:
pronouns: pronouns:
header: 'Местоимения' header: 'Местоимения'
headerLong: 'Местоимения и другие формы' headerLong: 'Местоимения и другие формы'
examples: 'Примеры употребления в предложениях' examples:
header: 'Примеры употребления в предложениях'
plural: 'Множественное число' plural: 'Множественное число'
intro: 'Мои местоимения' intro: 'Мои местоимения'
normative: 'Нормативное' normative: 'Нормативное'

View File

@ -63,7 +63,8 @@ home:
pronouns: pronouns:
header: 'Pronomen' header: 'Pronomen'
headerLong: 'Pronomen' headerLong: 'Pronomen'
examples: 'Exempel på användningar i meningar' examples:
header: 'Exempel på användningar i meningar'
plural: 'Plural' plural: 'Plural'
intro: 'Mina pronomen är' intro: 'Mina pronomen är'
normative: 'Normativ' normative: 'Normativ'

View File

@ -50,7 +50,8 @@ home:
pronouns: pronouns:
header: 'Zamirler' header: 'Zamirler'
headerLong: 'Zamirler' headerLong: 'Zamirler'
examples: 'Cumlede nasil gözükeceğini anlamak icin örnek kullanım' examples:
header: 'Cumlede nasil gözükeceğini anlamak icin örnek kullanım'
plural: 'Birden Çok' plural: 'Birden Çok'
intro: 'Benim zamirlerim' intro: 'Benim zamirlerim'
normative: 'Genel Zamirler' normative: 'Genel Zamirler'

View File

@ -54,7 +54,8 @@ home:
pronouns: pronouns:
header: 'Займенники' header: 'Займенники'
headerLong: 'Займенники та інші форми' headerLong: 'Займенники та інші форми'
examples: 'Приклади використання у реченнях' examples:
header: 'Приклади використання у реченнях'
plural: 'Множина' plural: 'Множина'
intro: 'Мої займенники' intro: 'Мої займенники'
normative: 'Нормативне' normative: 'Нормативне'

View File

@ -63,7 +63,8 @@ home:
pronouns: pronouns:
header: 'Các danh xưng' header: 'Các danh xưng'
headerLong: 'Các danh xưng' headerLong: 'Các danh xưng'
examples: 'Ví dụ trong câu' examples:
header: 'Ví dụ trong câu'
plural: 'Số nhiều' plural: 'Số nhiều'
intro: 'Tôi dùng các danh xưng' intro: 'Tôi dùng các danh xưng'
normative: 'Chuẩn mực' normative: 'Chuẩn mực'

View File

@ -60,7 +60,8 @@ home:
pronouns: pronouns:
header: 'פּראָנאָמען' header: 'פּראָנאָמען'
headerLong: 'פּראָנאָמען' headerLong: 'פּראָנאָמען'
examples: 'Example usage in sentences' examples:
header: 'Example usage in sentences'
plural: 'מערצאָל' plural: 'מערצאָל'
intro: 'מײַנע פּראָנאָמען זענען' intro: 'מײַנע פּראָנאָמען זענען'
normative: 'נאָרמאַטיװ' normative: 'נאָרמאַטיװ'

View File

@ -62,7 +62,8 @@ home:
pronouns: pronouns:
header: '代詞' header: '代詞'
headerLong: '代詞' headerLong: '代詞'
examples: '例句用法' examples:
header: '例句用法'
plural: '複數' plural: '複數'
intro: '我的代詞是' intro: '我的代詞是'
normative: '規範' normative: '規範'

View File

@ -29,7 +29,7 @@
<section> <section>
<h2 class="h4"> <h2 class="h4">
<Icon v="file-signature" /> <Icon v="file-signature" />
<T>pronouns.examples</T><T>quotation.colon</T> <T>pronouns.examples.header</T><T>quotation.colon</T>
</h2> </h2>
<ul> <ul>

View File

@ -55,7 +55,7 @@
<section> <section>
<h2 class="h4"> <h2 class="h4">
<Icon v="file-signature" /> <Icon v="file-signature" />
<T>pronouns.examples</T><T>quotation.colon</T> <T>pronouns.examples.header</T><T>quotation.colon</T>
</h2> </h2>
<ul> <ul>
@ -164,7 +164,7 @@ export default {
? head({ ? head({
title: `${this.$t('pronouns.intro')}: ${this.selectedPronoun.name(this.glue)}`, title: `${this.$t('pronouns.intro')}: ${this.selectedPronoun.name(this.glue)}`,
description: [ description: [
this.$t('pronouns.examples', {}, false), this.$t('pronouns.examples.header', {}, false),
this.$t('pronouns.grammarTable', {}, false), this.$t('pronouns.grammarTable', {}, false),
this.$t('sources.headerLong', {}, false), this.$t('sources.headerLong', {}, false),
].filter((x) => !!x).join(', '), ].filter((x) => !!x).join(', '),

View File

@ -85,7 +85,7 @@
</p> </p>
</div> </div>
<p> <p>
<T>pronouns.examples</T><T>quotation.colon</T> <T>pronouns.examples.header</T><T>quotation.colon</T>
</p> </p>
<template v-for="{ examples, isHonorific } in examplesByHonorific"> <template v-for="{ examples, isHonorific } in examplesByHonorific">
<ul> <ul>

View File

@ -82,6 +82,10 @@ export function listMissingTranslations(
return false; return false;
} }
if (!config.pronouns.exampleCategories && keyMatches('pronouns.examples.shuffleNamed')) {
return false;
}
if (!config.pronouns.slashes && keyMatches('pronouns.slashes.')) { if (!config.pronouns.slashes && keyMatches('pronouns.slashes.')) {
return false; return false;
} }