Skip to content

Commit

Permalink
Merge branch 'elk-zone:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdtms authored Nov 28, 2023
2 parents a44a2fe + 9c39eed commit c48e060
Show file tree
Hide file tree
Showing 27 changed files with 94 additions and 34 deletions.
27 changes: 27 additions & 0 deletions composables/settings/metadata.ts
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
import type { Node } from 'ultrahtml'
import { decode } from 'tiny-decode'
import { TEXT_NODE, parse } from 'ultrahtml'

export const maxAccountFieldCount = computed(() => isGlitchEdition.value ? 16 : 4)

export function convertMetadata(metadata: string) {
try {
const tree = parse(metadata)
return (tree.children as Node[]).map(n => convertToText(n)).join('').trim()
}
catch (err) {
console.error(err)
return ''
}
}

function convertToText(input: Node): string {
let text = ''

if (input.type === TEXT_NODE)
return decode(input.value)

if ('children' in input)
text = (input.children as Node[]).map(n => convertToText(n)).join('')

return text
}
3 changes: 2 additions & 1 deletion locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,8 @@
},
"featured_tags": {
"description": "يمكن للأشخاص تصفح مشاركاتك العامة تحت علامات الهاشتاغ هذه",
"label": "الهاشتاغ البارزة"
"label": "الهاشتاغ البارزة",
"under_construction": "تحت التطوير"
},
"label": "الملف الشخصي"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@
},
"featured_tags": {
"description": "La gent pot navegar per les teves publicacions públiques amb aquests hashtags.",
"label": "Hashtags destacats"
"label": "Hashtags destacats",
"under_construction": "En construcció"
},
"label": "Perfil"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@
},
"featured_tags": {
"description": "Leute können deine öffentlichen Beiträge mit diesen Hashtags ansehen.",
"label": "Ausgewählte Hashtags"
"label": "Ausgewählte Hashtags",
"under_construction": "In Bearbeitung"
},
"label": "Profil"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@
},
"featured_tags": {
"description": "People can browse your public posts under these hashtags.",
"label": "Featured hashtags"
"label": "Featured hashtags",
"under_construction": "Under construction"
},
"label": "Profile"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/es-419.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
},
"featured_tags": {
"description": "Los usuarios navegan por tus publicaciones públicas con estas etiquetas.",
"label": "Etiquetas destacadas"
"label": "Etiquetas destacadas",
"under_construction": "En desarrollo"
}
},
"users": {
Expand Down
3 changes: 2 additions & 1 deletion locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@
},
"featured_tags": {
"description": "Las personas pueden navegar por tus publicaciones públicas con estas etiquetas.",
"label": "Etiquetas destacadas"
"label": "Etiquetas destacadas",
"under_construction": "En construcción"
},
"label": "Perfil"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/eu-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,8 @@
},
"featured_tags": {
"description": "Jendeak traola hauek dituzten zure bidalketa publikoak ikus ditzazke.",
"label": "Nabarmendutako traolak"
"label": "Nabarmendutako traolak",
"under_construction": "Amaitzeke"
},
"label": "Profila"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/fi-FI.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@
},
"featured_tags": {
"description": "Ihmiset voivat selata julkisia julkaisujasi näillä aihetunnisteilla.",
"label": "Esiteltävät aihetunnisteet"
"label": "Esiteltävät aihetunnisteet",
"under_construction": "Rakenteilla"
},
"label": "Profiili"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@
},
"featured_tags": {
"description": "Les gens peuvent parcourir vos messages publics sous ces hashtags.",
"label": "Hashtags en vedette"
"label": "Hashtags en vedette",
"under_construction": "En construction"
},
"label": "Profil"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/gl-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@
},
"featured_tags": {
"description": "Será posible buscar as túas publicacións públicas con estos cancelos.",
"label": "Cancelos destacados"
"label": "Cancelos destacados",
"under_construction": "En desenvolvemento"
},
"label": "Perfil"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/hu-HU.json
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@
},
"featured_tags": {
"description": "Az emberek ezen hashtagek alatt böngészhetik nyilvános bejegyzéseit.",
"label": "Kiemelt hashtagek"
"label": "Kiemelt hashtagek",
"under_construction": "Felújítás alatt"
},
"label": "Profil"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,8 @@
},
"featured_tags": {
"description": "Orang-orang dapat menelusuri kiriman publik Anda di bawah tagar ini.",
"label": "Tagar unggulan"
"label": "Tagar unggulan",
"under_construction": "Dalam masa pembangunan"
},
"label": "Profil"
},
Expand Down
7 changes: 6 additions & 1 deletion locales/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"blocked_users": "Utenti bloccati",
"blocking": "Bloccato",
"bot": "BOT",
"copy_account_name": "Copia nome account",
"favourites": "Preferiti",
"follow": "Segui",
"follow_back": "Ricambia",
Expand Down Expand Up @@ -500,6 +501,8 @@
},
"notifications_settings": "Notifiche",
"preferences": {
"embedded_media": "Riproduttore media incorporato",
"embedded_media_description": "Visualizza un riproduttore incorporato invece della normale anteprima quando si espande un link a un contenuto multimediale.",
"enable_autoplay": "Attiva riproduzione automatica",
"enable_data_saving": "Attiva risparmio dati",
"enable_data_saving_description": "Risparmia dati disattivando il download automatico degli allegati.",
Expand Down Expand Up @@ -542,7 +545,8 @@
},
"featured_tags": {
"description": "Le altre persone possono sfogliare i tuoi post pubblici raccolti sotto questi hashtag.",
"label": "Hashtag in evidenza"
"label": "Hashtag in evidenza",
"under_construction": "Lavori in corso"
},
"label": "Profilo"
},
Expand Down Expand Up @@ -577,6 +581,7 @@
},
"boosted_by": "Potenziato da",
"edited": "Modificato {0}",
"embedded_warning": "La riproduzione di questo contenuto potrebbe rivelare il tuo indirizzo IP ad altri.",
"favourited_by": "Apprezzato da",
"filter_hidden_phrase": "Filtrato da",
"filter_show_anyway": "Mostra comunque",
Expand Down
3 changes: 2 additions & 1 deletion locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,8 @@
},
"featured_tags": {
"description": "他のユーザーはこれらのハッシュタグであなたの公開投稿を閲覧できます。",
"label": "注目のハッシュタグ"
"label": "注目のハッシュタグ",
"under_construction": "工事中"
},
"label": "プロフィール"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/pl-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@
},
"featured_tags": {
"description": "Ludzie mogą przeglądać Twoje publiczne wpisy pod tymi hasztagami.",
"label": "Polecane hasztagi"
"label": "Polecane hasztagi",
"under_construction": "W budowie"
},
"label": "Profil"
},
Expand Down
9 changes: 7 additions & 2 deletions locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"blocked_users": "Utilizadores bloqueados",
"blocking": "Bloqueado",
"bot": "BOT",
"copy_account_name": "Copiar nome da conta",
"favourites": "Favoritos",
"follow": "Seguir",
"follow_back": "Seguir de volta",
Expand Down Expand Up @@ -257,7 +258,7 @@
"share_post": "Partilhar esta publicação",
"show_favourited_and_boosted_by": "Mostrar quem adicionou aos favoritos e partilhou",
"show_reblogs": "Mostrar partilhas de {0}",
"show_untranslated": "Mostrar não traduzidas",
"show_untranslated": "Esconder tradução",
"toggle_theme": {
"dark": "Alternar modo escuro",
"light": "Alternar modo claro"
Expand Down Expand Up @@ -500,6 +501,8 @@
},
"notifications_settings": "Notificações",
"preferences": {
"embedded_media": "Leitor de Media Incorporado",
"embedded_media_description": "Quando é publicada uma ligação para uma transmissão de media, é apresentado um leitor incorporado ao invés do cartão de pré-visualização normal.",
"enable_autoplay": "Habilitar Reprodução Automática",
"enable_data_saving": "Habilitar poupança de dados",
"enable_data_saving_description": "Poupar dados, impedindo que os anexos sejam carregados automaticamente.",
Expand Down Expand Up @@ -542,7 +545,8 @@
},
"featured_tags": {
"description": "As pessoas podem encontrar as suas publicações públicas que incluem essas hashtags.",
"label": "Hashtags destacadas"
"label": "Hashtags destacadas",
"under_construction": "Em construção"
},
"label": "Perfil"
},
Expand Down Expand Up @@ -577,6 +581,7 @@
},
"boosted_by": "Partilhada Por",
"edited": "Editada {0}",
"embedded_warning": "Reproduzir isto pode revelar o seu endereço de IP a outros.",
"favourited_by": "Adicionada Aos Favoritos Por",
"filter_hidden_phrase": "Filtrada por",
"filter_show_anyway": "Mostrar mesmo assim",
Expand Down
3 changes: 2 additions & 1 deletion locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@
},
"featured_tags": {
"description": "Люди могут просматривать ваши публичные посты под этими хэштегами.",
"label": "Рекомендуемые хэштеги"
"label": "Рекомендуемые хэштеги",
"under_construction": "В разработке"
},
"label": "Профиль"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/th-TH.json
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@
},
"featured_tags": {
"description": "ผู้คนสามารถเรียกดูโพสต์สาธารณะของคุณภายใต้แฮชแท็กเหล่านี้",
"label": "แฮชแท็กเด่น"
"label": "แฮชแท็กเด่น",
"under_construction": "อยู่ระหว่างพัฒนา"
},
"label": "โปรไฟล์"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/tl-PH.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@
},
"featured_tags": {
"description": "Maaring i-browse ng mga tao ang iyong mga public post gamit ang mga hashtags na ito.",
"label": "Napiling mga hashtags"
"label": "Napiling mga hashtags",
"under_construction": "Nasa ilalim ng konstruksyon"
},
"label": "Profile"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@
},
"featured_tags": {
"description": "İnsanlar bu etiketlerler altında herkese açık gönderilerinize göz atabilir.",
"label": "Öne çıkan etiketler"
"label": "Öne çıkan etiketler",
"under_construction": "Yapım halinde"
},
"label": "Profil"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/vi-VN.json
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,8 @@
},
"featured_tags": {
"description": "Mọi người có thể tìm các tút công khai có chứa những hashtag đó.",
"label": "Hashtag thường dùng"
"label": "Hashtag thường dùng",
"under_construction": "Đang được xây dựng"
},
"label": "Hồ sơ"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@
},
"featured_tags": {
"description": "人们可以在这些标签下浏览你的公共嘟文。",
"label": "精选话题标签"
"label": "精选话题标签",
"under_construction": "建设中"
},
"label": "个人资料"
},
Expand Down
3 changes: 2 additions & 1 deletion locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@
},
"featured_tags": {
"description": "人們可以在這些標籤下瀏覽你的公開嘟文。",
"label": "精選的話題標籤"
"label": "精選的話題標籤",
"under_construction": "建立中"
},
"label": "個人資料"
},
Expand Down
16 changes: 10 additions & 6 deletions pages/settings/notifications/notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ useHydratedHead({
<MainContent back>
<template #title>
<div text-lg font-bold flex items-center gap-2 @click="$scrollToTop">
<div i-ri:test-tube-line />
<span>{{ isHydrated ? $t('settings.notifications.notifications.label') : '' }}</span>
</div>
</template>
<h3 px6 py4 mt2 font-bold text-xl flex="~ gap-1" items-center>
{{ isHydrated ? $t('settings.notifications.notifications.label') : '' }}
</h3>
<p text-4xl text-center>
<span sr-only>{{ isHydrated ? $t('settings.notifications.under_construction') : '' }}</span> 🚧
</p>
<div text-center mt-10>
<h1 text-4xl>
<span sr-only>{{ isHydrated ? $t('settings.notifications.under_construction') : '' }}</span>
🚧
</h1>
<h3 text-xl>
{{ isHydrated ? $t('settings.notifications.notifications.label') : '' }}
</h3>
</div>
</MainContent>
</template>
5 changes: 1 addition & 4 deletions pages/settings/profile/appearance.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts" setup>
import type { mastodon } from 'masto'
import { useForm } from 'slimeform'
import { parse } from 'ultrahtml'
definePageMeta({
middleware: 'auth',
Expand Down Expand Up @@ -31,9 +30,7 @@ const { form, reset, submitter, isDirty, isError } = useForm({
const fieldsAttributes = Array.from({ length: maxAccountFieldCount.value }, (_, i) => {
const field = { ...account?.fields?.[i] || { name: '', value: '' } }
const linkElement = (parse(field.value)?.children?.[0])
if (linkElement && linkElement?.attributes?.href)
field.value = linkElement.attributes.href
field.value = convertMetadata(field.value)
return field
})
Expand Down
1 change: 1 addition & 0 deletions pages/settings/profile/featured-tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ useHydratedHead({
</template>
<div text-center mt-10>
<h1 text-4xl>
<span sr-only>{{ $t('settings.profile.featured_tags.under_construction') }}</span>
🚧
</h1>
<h3 text-xl>
Expand Down

0 comments on commit c48e060

Please sign in to comment.