From aca6f162452b0be5e1e0e5b3b5f57ef45c9af747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Mon, 2 Jan 2023 05:52:00 +0800 Subject: [PATCH] feat(publish): support status language relate issue #332 --- components/publish/PublishWidget.vue | 40 ++++++++++++++++++++++++++++ locales/en-GB.json | 1 + locales/en-US.json | 1 + locales/zh-CN.json | 1 + locales/zh-TW.json | 1 + package.json | 1 + pnpm-lock.yaml | 12 +++++++-- 7 files changed, 55 insertions(+), 2 deletions(-) diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index 05646bc0..63e4d4c9 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -3,6 +3,7 @@ import type { Attachment, CreateStatusParams, Status, StatusVisibility } from 'm import { fileOpen } from 'browser-fs-access' import { useDropZone } from '@vueuse/core' import { EditorContent } from '@tiptap/vue-3' +import ISO6391 from 'iso-639-1' import type { Draft } from '~/types' type FileUploadError = [filename: string, message: string] @@ -135,6 +136,10 @@ function chooseVisibility(visibility: StatusVisibility) { draft.params.visibility = visibility } +function chooseLanguage(language: string | null) { + draft.params.language = language +} + async function publish() { const payload = { ...draft.params, @@ -323,6 +328,41 @@ defineExpose({ + + + + + + + +