Add locales and new navbar entry

This commit is contained in:
Marie 2024-12-12 21:45:54 +01:00
parent d18317a7c8
commit dddfdf8a13
No known key found for this signature in database
GPG key ID: 7ADF6C9CD9A28555
5 changed files with 26 additions and 4 deletions

8
locales/index.d.ts vendored
View file

@ -11464,6 +11464,14 @@ export interface Locale extends ILocale {
* List of scheduled notes * List of scheduled notes
*/ */
"schedulePostList": string; "schedulePostList": string;
/**
* Post on
*/
"postOn": string;
/**
* Scheduled Notes
*/
"scheduledNotes": string;
} }
declare const locales: { declare const locales: {
[lang: string]: Locale; [lang: string]: Locale;

View file

@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-show="note.cw == null || showContent"> <div v-show="note.cw == null || showContent">
<MkSubNoteContent :hideFiles="hideFiles" :class="$style.text" :note="note" :expandAllCws="props.expandAllCws"/> <MkSubNoteContent :hideFiles="hideFiles" :class="$style.text" :note="note" :expandAllCws="props.expandAllCws"/>
<div v-if="note.isSchedule" style="margin-top: 10px;"> <div v-if="note.isSchedule" style="margin-top: 10px;">
<MkButton :class="$style.button" inline @click.stop.prevent="editScheduleNote()"><i class="ti ti-eraser"></i> {{ i18n.ts.deleteAndEdit }}</MkButton> <MkButton :class="$style.button" inline @click.stop.prevent="editScheduleNote()"><i class="ti ti-eraser"></i> {{ i18n.ts.edit }}</MkButton>
<MkButton :class="$style.button" inline danger @click.stop.prevent="deleteScheduleNote()"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton> <MkButton :class="$style.button" inline danger @click.stop.prevent="deleteScheduleNote()"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
</div> </div>
</div> </div>

View file

@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div style="padding: 8px 16px;"> <div style="padding: 8px 16px;">
<section> <section>
<MkInput v-model="atDate" small type="date" class="input"> <MkInput v-model="atDate" small type="date" class="input">
<template #label>{{ i18n.ts._poll.deadlineDate }}</template> <template #label>{{ i18n.ts.postOn }}</template>
</MkInput> </MkInput>
<MkInput v-model="atTime" small type="time" class="input"> <MkInput v-model="atTime" small type="time" class="input">
<template #label>{{ i18n.ts._poll.deadlineTime }}</template> <template #label>{{ i18n.ts._poll.deadlineTime }}</template>

View file

@ -3,7 +3,8 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { computed, reactive } from 'vue'; import { computed, defineAsyncComponent, reactive } from 'vue';
import { ui } from '@@/js/config.js';
import { clearCache } from './scripts/clear-cache.js'; import { clearCache } from './scripts/clear-cache.js';
import { instance } from './instance.js'; import { instance } from './instance.js';
import { $i } from '@/account.js'; import { $i } from '@/account.js';
@ -12,7 +13,6 @@ import { openInstanceMenu } from '@/ui/_common_/common.js';
import { lookup } from '@/scripts/lookup.js'; import { lookup } from '@/scripts/lookup.js';
import * as os from '@/os.js'; import * as os from '@/os.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { ui } from '@@/js/config.js';
import { unisonReload } from '@/scripts/unison-reload.js'; import { unisonReload } from '@/scripts/unison-reload.js';
export const navbarItemDef = reactive({ export const navbarItemDef = reactive({
@ -74,6 +74,18 @@ export const navbarItemDef = reactive({
show: computed(() => $i != null && !$i.movedTo), show: computed(() => $i != null && !$i.movedTo),
to: '/following-feed', to: '/following-feed',
}, },
scheduledNotes: {
title: i18n.ts.scheduledNotes,
icon: 'ti ti-calendar-event',
show: computed(() => $i != null),
action: (ev) => {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkSchedulePostListDialog.vue')), {}, {
closed: () => {
dispose();
},
});
},
},
lists: { lists: {
title: i18n.ts.lists, title: i18n.ts.lists,
icon: 'ti ti-list', icon: 'ti ti-list',

View file

@ -422,6 +422,8 @@ selectFollowRelationship: "Select a follow relationship..."
schedulePost: "Schedule a note" schedulePost: "Schedule a note"
schedulePostList: "List of scheduled notes" schedulePostList: "List of scheduled notes"
postOn: "Post on"
scheduledNotes: "Scheduled Notes"
_permissions: _permissions:
"read:notes-schedule": "View your list of scheduled notes" "read:notes-schedule": "View your list of scheduled notes"