#112 [flags][pl] tłumaczenie flag
This commit is contained in:
parent
356abf8090
commit
52d35699d5
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<span>
|
||||
<span :title="name">
|
||||
<img :src="src" alt=""/>
|
||||
{{ name }}
|
||||
{{ translatedName }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
|
@ -10,7 +10,15 @@
|
|||
props: {
|
||||
name: { required: true },
|
||||
src: { required: true },
|
||||
}
|
||||
pronoun: { required: true },
|
||||
},
|
||||
computed: {
|
||||
translatedName() {
|
||||
return this.pronoun.format(
|
||||
this.$t(`flags.${this.name.replace(/ /g, '_')}`, {}, false) || this.name
|
||||
);
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -250,6 +250,8 @@ profile:
|
|||
- ['person', 'man', 'woman', 'lady', 'dude', 'boy', 'girl', 'buddy', 'pal', 'bro', 'sis', 'sib']
|
||||
- ['pretty', 'handsome', 'cute', 'hot', 'sexy']
|
||||
- ['friend', 'partner', 'boyfriend', 'girlfriend', 'joyfriend', 'husband', 'wife', 'kissmate', 'darling', 'beloved', 'boo']
|
||||
flags:
|
||||
defaultPronoun: 'they'
|
||||
|
||||
redirects: []
|
||||
|
||||
|
|
|
@ -388,6 +388,8 @@ profile:
|
|||
- ['per ty', 'per wy', 'pan', 'pani', 'państwo', 'pań', 'panu', 'osoba', 'mężczyzna', 'kobieta', 'enby', 'niebinie', 'facet', 'baba', 'ziom', 'laska', 'typ']
|
||||
- ['ładn_', 'śliczn_', 'przystojn_', 'słodk_']
|
||||
- ['partner', 'osoba partnerska', 'chłopak', 'dziewczyna', 'mąż', 'żona', 'towarzysz', 'kochanie', 'ukochane', 'małżonie', 'druga połówka']
|
||||
flags:
|
||||
defaultPronoun: 'on_'
|
||||
|
||||
redirects:
|
||||
- { from: '^/neutratywy', to: '/s%C5%82ownik' }
|
||||
|
|
|
@ -941,3 +941,67 @@ localise:
|
|||
short: 'Dodawanie nowych wersji językowych'
|
||||
long: 'Chcesz dodać nową wersję językową? Informacje znajdziesz w'
|
||||
longLink: 'tej instrukcji.'
|
||||
|
||||
flags:
|
||||
Abrosexual: 'Abroseksualn{adjective_n}'
|
||||
Achillean: 'Achillejsk{adjective_n}'
|
||||
Agender: 'Apłciow{adjective_n}'
|
||||
Anarcha-Queer: 'Anarchoqueerow{adjective_n}'
|
||||
Androgyne: 'Androgyniczn{adjective_n}'
|
||||
Androsexual: 'Androseksualn{adjective_n}'
|
||||
Aporagender: 'Aporapłciow{adjective_n}'
|
||||
Aroace: 'Aromantyczno-Aseksualn{adjective_n}'
|
||||
Aromantic: 'Aromantyczn{adjective_n}'
|
||||
Asexual: 'Aseksualn{adjective_n}'
|
||||
Autigender: 'Autypłciow{adjective_n}' # Autigenderow{adjective_n}
|
||||
Bear: 'Misiek'
|
||||
Bigender: 'Bipłciow{adjective_n}' # Dwupłciow{adjective_n}
|
||||
Bisexual: 'Biseksualn{adjective_n}'
|
||||
Butch: 'Butch, Bacz'
|
||||
Ceterosexual: 'Ceteroseksualn{adjective_n}'
|
||||
Cis_Ally: 'Osoba sojusznicza'
|
||||
Demiboy: 'Demichłopię' # Demichłopak
|
||||
Demigender: 'Demipłciow{adjective_n}'
|
||||
Demigirl: 'Demidziewczę' # demidziewczyna
|
||||
Demiromantic: 'Demiromantyczn{adjective_n}'
|
||||
Demisexual: 'Demiseksualn{adjective_n}'
|
||||
Diamoric: 'Diamoryczn{adjective_n}'
|
||||
Enbian: 'Enbiańsk{adjective_n}' # Niebiańsk{adjective_n}
|
||||
Gender_questioning: 'Kwestionując{adjective_n} swoją płeć' # Zastanawiając{adjective_n} się nad swoją płcią
|
||||
Genderfae: 'Nimficzn{adjective_n}'
|
||||
Genderfaun: 'Fauniczn{adjective_n}'
|
||||
Genderfluid: 'Płynnopłciow{adjective_n}'
|
||||
Genderflux: 'Zmiennopłciow{adjective_n}'
|
||||
Genderqueer: 'Nienormatywn{adjective_n} płciowo' # Płeć Queerowa
|
||||
Greyasexual: 'Szaroaseksualn{adjective_n}'
|
||||
Greyaromantic: 'Szaroaromantyczn{adjective_n}'
|
||||
Gynesexual: 'Gyneseksualn{adjective_n}'
|
||||
Intersex: 'Interpłciow{adjective_n}'
|
||||
LGBTQ: 'LGBTQ'
|
||||
Leather_Pride: 'Skórzak'
|
||||
Lesbian: 'Lesbijka'
|
||||
Lipstick_Lesbian: 'Kobieca lesbijka'
|
||||
Maverique: 'Maweryczn{adjective_n}'
|
||||
Nebularomantic: 'Mglistoromantyczn{adjective_n}'
|
||||
Neutrois: 'Neutraln{adjective_n} płciowo'
|
||||
Nonbinary: 'Niebinarn{adjective_n}'
|
||||
Omnisexual: 'Omniseksualn{adjective_n}'
|
||||
Pangender: 'Panpłciow{adjective_n}' # Pangenderow{adjective_n} Wszechpłciow{adjective_n}
|
||||
Pansexual: 'Panseksualn{adjective_n}'
|
||||
Polyamorous: 'Poliamoryczn{adjective_n}'
|
||||
Polysexual: 'Poliseksualn{adjective_n}'
|
||||
Pomosexual: 'Pomoseksualn{adjective_n}'
|
||||
Progress_Pride: 'Progresywn{adjective_n}'
|
||||
Queer: 'Queer (kłir)'
|
||||
Queerian: 'Queerejsk{adjective_n}'
|
||||
Queerplatonic: 'Queerplatoniczn{adjective_n}'
|
||||
Quoiromantic: 'Quoiromantyczn{adjective_n}' # Jakromantyczn{adjective_n}
|
||||
Sapphic: 'Safick{adjective_n}' # Safik, Sapphic
|
||||
Straight_Ally: 'Osoba sojusznicza'
|
||||
Toric: 'Toryczn{adjective_n}'
|
||||
Transfeminine: 'Transkobiec{adjective_n}'
|
||||
Transgender: 'Transpłciow{adjective_n}'
|
||||
Transmasculine: 'Transmęsk{adjective_n}'
|
||||
Trigender: 'Tripłciow{adjective_n}' # Trójpłciow{adjective_n}
|
||||
Trixic: 'Triksyjsk{adjective_n}'
|
||||
Xenogender: 'Ksenopłciow{adjective_n}'
|
||||
|
|
|
@ -6,12 +6,14 @@
|
|||
@{{username}}
|
||||
</h2>
|
||||
<div>
|
||||
<nuxt-link v-if="$user() && $user().username === username" to="/editor"
|
||||
class="btn btn-outline-primary btn-sm mb-2"
|
||||
>
|
||||
<Icon v="edit"/>
|
||||
<T>profile.edit</T>
|
||||
</nuxt-link>
|
||||
<div class="text-right">
|
||||
<nuxt-link v-if="$user() && $user().username === username" to="/editor"
|
||||
class="btn btn-outline-primary btn-sm mb-2"
|
||||
>
|
||||
<Icon v="edit"/>
|
||||
<T>profile.edit</T>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
<div class="list-group" v-if="Object.keys(profiles).length > 1">
|
||||
<a :href="`https://pronouns.page/@${username}`" v-if="$user() && $user().username === username"
|
||||
class="list-group-item list-group-item-action small px-4 py-2 text-center"
|
||||
|
@ -41,7 +43,7 @@
|
|||
<section v-if="profile.flags.length">
|
||||
<ul class="list-inline">
|
||||
<li v-for="flag in profile.flags" class="list-inline-item pr-2">
|
||||
<Flag :name="allFlags[flag]" :src="`/flags/${flag}.png`"/>
|
||||
<Flag :name="allFlags[flag]" :src="`/flags/${flag}.png`" :pronoun="mainPronoun"/>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
@ -171,6 +173,21 @@
|
|||
}
|
||||
return pronounOpinions;
|
||||
},
|
||||
mainPronoun() {
|
||||
let mainPronoun = buildPronoun(pronouns, this.config.profile.flags.defaultPronoun);
|
||||
let mainOpinion = -1;
|
||||
for (let {pronoun, opinion} of this.pronounOpinions) {
|
||||
if (opinion === 2) {
|
||||
opinion = 0.5;
|
||||
}
|
||||
if (opinion > mainOpinion) {
|
||||
mainPronoun = pronoun;
|
||||
mainOpinion = opinion;
|
||||
}
|
||||
}
|
||||
|
||||
return mainPronoun;
|
||||
},
|
||||
},
|
||||
head() {
|
||||
return head({
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<T>profile.flagsInfo</T>
|
||||
</p>
|
||||
<ButtonList v-model="flags" :options="allFlags" v-slot="s">
|
||||
<Flag :name="s.desc" :src="`/flags/${s.v}.png`"/>
|
||||
<Flag :name="s.desc" :src="`/flags/${s.v}.png`" :pronoun="mainPronoun"/>
|
||||
</ButtonList>
|
||||
</div>
|
||||
|
||||
|
@ -188,7 +188,7 @@
|
|||
this.saving = false;
|
||||
this.$router.push(`/@${this.$user().username}`)
|
||||
},
|
||||
validatePronoun(pronoun) {
|
||||
normalisePronoun(pronoun) {
|
||||
const link = decodeURIComponent(
|
||||
pronoun
|
||||
.toLowerCase()
|
||||
|
@ -198,7 +198,30 @@
|
|||
.replace(new RegExp('^/'), '')
|
||||
);
|
||||
|
||||
return buildPronoun(pronouns, link) ? null : 'profile.pronounsNotFound'
|
||||
return buildPronoun(pronouns, link);
|
||||
},
|
||||
validatePronoun(pronoun) {
|
||||
return this.normalisePronoun(pronoun) ? null : 'profile.pronounsNotFound'
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
mainPronoun() {
|
||||
let mainPronoun = buildPronoun(pronouns, this.config.profile.flags.defaultPronoun);
|
||||
let mainOpinion = -1;
|
||||
for (let {key: pronoun, value: opinion} of this.pronouns) {
|
||||
if (opinion === 2) {
|
||||
opinion = 0.5;
|
||||
}
|
||||
if (opinion > mainOpinion) {
|
||||
const p = this.normalisePronoun(pronoun);
|
||||
if (p) {
|
||||
mainPronoun = p;
|
||||
mainOpinion = opinion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mainPronoun;
|
||||
},
|
||||
},
|
||||
head() {
|
||||
|
|
|
@ -384,6 +384,10 @@ export class Pronoun {
|
|||
return this.pluralHonorific[counter % this.pluralHonorific.length]
|
||||
}
|
||||
|
||||
format(str) {
|
||||
return str.replace(/{[^}]+}/g, m => this.morphemes[m.substring(1, m.length - 1)]);
|
||||
}
|
||||
|
||||
toArray() {
|
||||
const elements = Object.values(this.morphemes).map(s => escape(s));
|
||||
Object.values(this.pronunciations).forEach((p, i) => {
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import translations from '../data/translations.suml';
|
||||
|
||||
export default (key, params = {}) => {
|
||||
export default (key, params = {}, warn = true) => {
|
||||
let value = translations;
|
||||
for (let part of key.split('.')) {
|
||||
value = value[part];
|
||||
if (value === undefined) {
|
||||
console.error('Cannot find translation: ' + key);
|
||||
if (warn) {
|
||||
console.error('Cannot find translation: ' + key);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Reference in New Issue