chore: format

This commit is contained in:
naskya 2024-03-28 14:26:09 +09:00
parent 284f077dba
commit 611a2f02b9
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
6 changed files with 139 additions and 77 deletions

View file

@ -583,7 +583,7 @@ export async function addFile({
file.requestHeaders = requestHeaders;
file.isSensitive = user
? Users.isLocalUser(user) &&
(instance!.markLocalFilesNsfwByDefault || profile!.alwaysMarkNsfw)
(instance!.markLocalFilesNsfwByDefault || profile!.alwaysMarkNsfw)
? true
: sensitive != null
? sensitive

View file

@ -38,11 +38,11 @@ const props = withDefaults(
defineProps<{
file: entities.DriveFile;
fit: string;
showAltIndicator?: boolean
showAltIndicator?: boolean;
}>(),
{
showAltIndicator: false,
}
},
);
const is = computed(() => {

View file

@ -27,9 +27,7 @@
v-if="alt && showAltIndicator"
v-tooltip.noLabel="
`${i18n.ts.alt}: ${
alt.length > 200
? alt.trim().slice(0, 200) + '...'
: alt.trim()
alt.length > 200 ? alt.trim().slice(0, 200) + '...' : alt.trim()
}`
"
></i>
@ -51,7 +49,7 @@ const props = withDefaults(
size?: number;
cover?: boolean;
largestDimension?: "width" | "height";
showAltIndicator?: boolean
showAltIndicator?: boolean;
}>(),
{
src: null,
@ -60,7 +58,7 @@ const props = withDefaults(
title: null,
size: 64,
cover: true,
showAltIndicator: false
showAltIndicator: false,
},
);

View file

@ -1017,8 +1017,6 @@ function deleteDraft() {
localStorage.setItem("drafts", JSON.stringify(draftData));
}
async function post() {
// For text that is too short, the false positive rate may be too high, so we don't show alarm.
if (defaultStore.state.autocorrectNoteLanguage && text.value.length > 10) {

View file

@ -382,69 +382,129 @@ export const iso639Regional = {
export const langmap = Object.assign({}, langmapNoRegion, iso639Regional);
/**
* @see https://github.com/komodojp/tinyld/blob/develop/docs/langs.md
*/
* @see https://github.com/komodojp/tinyld/blob/develop/docs/langs.md
*/
export const supportedLangs: Record<string, boolean> = {
af: true, afr: true,
am: true, amh: true,
ber: true,
rn: true, run: true,
my: true, mya: true,
id: true, ind: true,
km: true, khm: true,
tl: true, tgl: true,
th: true, tha: true,
vi: true, vie: true,
zh: true, cmn: true,
ja: true, jpn: true,
ko: true, kor: true,
bn: true, ben: true,
gu: true, guj: true,
hi: true, hin: true,
kn: true, kan: true,
ta: true, tam: true,
te: true, tel: true,
ur: true, urd: true,
cs: true, ces: true,
el: true, ell: true,
la: true, lat: true,
mk: true, mkd: true,
sr: true, srp: true,
sk: true, slk: true,
be: true, bel: true,
bg: true, bul: true,
et: true, est: true,
hu: true, hun: true,
lv: true, lvs: true,
lt: true, lit: true,
pl: true, pol: true,
ro: true, ron: true,
ru: true, rus: true,
uk: true, ukr: true,
da: true, dan: true,
fi: true, fin: true,
is: true, isl: true,
no: true, nob: true,
sv: true, swe: true,
nl: true, nld: true,
en: true, eng: true,
fr: true, fra: true,
de: true, deu: true,
ga: true, gle: true,
it: true, ita: true,
pt: true, por: true,
es: true, spa: true,
ar: true, ara: true,
hy: true, hye: true,
he: true, heb: true,
kk: true, kaz: true,
mn: true, mon: true,
fa: true, pes: true,
tt: true, tat: true,
tr: true, tur: true,
tk: true, tuk: true,
yi: true, yid: true,
eo: true, epo: true,
tlh: true,
vo: true, vol: true,
}
af: true,
afr: true,
am: true,
amh: true,
ber: true,
rn: true,
run: true,
my: true,
mya: true,
id: true,
ind: true,
km: true,
khm: true,
tl: true,
tgl: true,
th: true,
tha: true,
vi: true,
vie: true,
zh: true,
cmn: true,
ja: true,
jpn: true,
ko: true,
kor: true,
bn: true,
ben: true,
gu: true,
guj: true,
hi: true,
hin: true,
kn: true,
kan: true,
ta: true,
tam: true,
te: true,
tel: true,
ur: true,
urd: true,
cs: true,
ces: true,
el: true,
ell: true,
la: true,
lat: true,
mk: true,
mkd: true,
sr: true,
srp: true,
sk: true,
slk: true,
be: true,
bel: true,
bg: true,
bul: true,
et: true,
est: true,
hu: true,
hun: true,
lv: true,
lvs: true,
lt: true,
lit: true,
pl: true,
pol: true,
ro: true,
ron: true,
ru: true,
rus: true,
uk: true,
ukr: true,
da: true,
dan: true,
fi: true,
fin: true,
is: true,
isl: true,
no: true,
nob: true,
sv: true,
swe: true,
nl: true,
nld: true,
en: true,
eng: true,
fr: true,
fra: true,
de: true,
deu: true,
ga: true,
gle: true,
it: true,
ita: true,
pt: true,
por: true,
es: true,
spa: true,
ar: true,
ara: true,
hy: true,
hye: true,
he: true,
heb: true,
kk: true,
kaz: true,
mn: true,
mon: true,
fa: true,
pes: true,
tt: true,
tat: true,
tr: true,
tur: true,
tk: true,
tuk: true,
yi: true,
yid: true,
eo: true,
epo: true,
tlh: true,
vo: true,
vol: true,
};

View file

@ -20,7 +20,10 @@ export function isSupportedLang(langCode: string | null) {
* Compare two language codes to determine whether they are decisively different
* @returns false if they are close enough
*/
export function isSameLanguage(langCode1: string | null, langCode2: string | null) {
export function isSameLanguage(
langCode1: string | null,
langCode2: string | null,
) {
return (
languageContains(langCode1, langCode2) ||
languageContains(langCode2, langCode1)
@ -30,7 +33,10 @@ export function isSameLanguage(langCode1: string | null, langCode2: string | nul
/**
* Returns true if langCode1 contains langCode2
*/
export function languageContains(langCode1: string | null, langCode2: string | null) {
export function languageContains(
langCode1: string | null,
langCode2: string | null,
) {
if (!langCode1 || !langCode2) return false;
return parentLanguage(langCode2) === langCode1;