PronounsPage/locale/pl/nouns/osobatywy.vue
Valentyne Stigloher 10180aa6a3 (refactor) use #shared alias instead of ~~/shared
the #shared alias used by Nuxt cannot be easily disabled and to prevent breackage with jiti, we make use of it
2025-08-17 18:56:02 +02:00

173 lines
5.5 KiB
Vue

<script setup lang="ts">
import { useNuxtApp } from 'nuxt/app';
import NounsNav from './NounsNav.vue';
import { Noun, SourceLibrary } from '#shared/classes.ts';
import type { Source } from '#shared/classes.ts';
import { neutralGenderNameInjectionKey } from '#shared/injectionKeys.ts';
import { availableGenders } from '#shared/nouns.ts';
import useConfig from '~/composables/useConfig.ts';
definePageMeta({
translatedPaths: (config) => translatedPathForSingleLocale(config, 'pl', 'osobatywy'),
});
const { $translator: translator } = useNuxtApp();
useSimpleHead({
title: translator.translate('nouns.personNouns.header'),
description: translator.translate('nouns.personNouns.info')[0],
}, translator);
const config = useConfig();
provide(neutralGenderNameInjectionKey, translator.translate('nouns.personNouns.label'));
const personNouns = [
new Noun(config, {
id: 'kandydat',
words: {
masc: {
singular: [{ spelling: 'kandydat' }],
plural: [{ spelling: 'kandydaci' }],
},
fem: {
singular: [{ spelling: 'kandydatka' }],
plural: [{ spelling: 'kandydatki' }],
},
neutr: {
singular: [{ spelling: 'osoba kandydująca' }],
plural: [{ spelling: 'osoby kandydujące' }],
},
},
}),
new Noun(config, {
id: 'kucharz',
words: {
masc: {
singular: [{ spelling: 'kucharz' }],
plural: [{ spelling: 'kucharze' }],
},
fem: {
singular: [{ spelling: 'kucharka' }],
plural: [{ spelling: 'kucharki' }],
},
neutr: {
singular: [{ spelling: 'osoba gotująca' }, { spelling: 'osoba kucharska' }],
plural: [{ spelling: 'osoby gotujące' }, { spelling: 'osoby kucharskie' }],
},
},
}),
new Noun(config, {
id: 'mężczyzna',
words: {
masc: {
singular: [{ spelling: 'mężczyzna' }],
plural: [{ spelling: 'mężczyźni' }],
},
fem: {
singular: [{ spelling: 'kobieta' }],
plural: [{ spelling: 'kobiety' }],
},
neutr: {
singular: [{ spelling: 'osoba' }, { spelling: 'osoba niebinarna' }],
plural: [{ spelling: 'osoby' }, { spelling: 'osoby niebinarne' }],
},
},
}),
new Noun(config, {
id: 'partner',
words: {
masc: {
singular: [{ spelling: 'partner' }],
plural: [{ spelling: 'partnerzy' }],
},
fem: {
singular: [{ spelling: 'partnerka' }],
plural: [{ spelling: 'partnerki' }],
},
neutr: {
singular: [{ spelling: 'osoba partnerska' }],
plural: [{ spelling: 'osoby partnerskie' }],
},
},
}),
new Noun(config, {
id: 'prezes',
words: {
masc: {
singular: [{ spelling: 'prezes' }],
plural: [{ spelling: 'prezesi' }],
},
fem: {
singular: [{ spelling: 'prezeska' }],
plural: [{ spelling: 'prezeski' }],
},
neutr: {
singular: [{ spelling: 'osoba prezesująca' }],
plural: [{ spelling: 'osoby prezesujące' }],
},
},
}),
];
const sources = ref<Record<string, Source[] | undefined>>();
onMounted(async () => {
const rawSources = await $fetch('/api/sources', { query: { pronoun: 'osobatywy' } });
sources.value = {
'': new SourceLibrary(config, rawSources).getForPronoun('osobatywy'),
};
});
</script>
<template>
<Page>
<NounsNav />
<h2>
<Icon v="user-friends" />
<T>nouns.personNouns.header</T>
<small><NormativeBadge /></small>
</h2>
<div>
<T>nouns.personNouns.info</T>
<CensusStat type="nouns" item="osobatywy" colour="info" />
<Share :title="$t('nouns.personNouns.header')" />
</div>
<section>
<BlogEntriesList :posts="['krótka-notka-o-osobatywach', 'osobatywy-nie-takie-straszne', 'osoby-polskie']" />
</section>
<details open class="border mb-3">
<summary class="bg-light p-3">
<h4 class="h5 d-inline">
<T>nouns.examples</T>
</h4>
</summary>
<div class="border-top table-responsive nouns-table">
<div class="container">
<div class="row-header p-2 d-grid gap-2 border-top">
<div v-for="gender of availableGenders(config)" :key="gender" class="d-none d-md-block bold">
<NounsGenderLabel :gender />
</div>
</div>
<div></div>
<div
v-for="noun of personNouns"
:key="noun.id"
class="row-content p-2 d-grid gap-2 border-top"
>
<NounsTableEntry :noun />
</div>
</div>
</div>
</details>
<section v-if="sources && Object.keys(sources).length">
<Literature :sources="sources" />
</section>
</Page>
</template>