Support `language` param with L tags
This commit is contained in:
parent
4361c340b0
commit
45dee96219
|
@ -104,6 +104,11 @@ const createStatusController: AppController = async (c) => {
|
|||
tags.push(['subject', data.spoiler_text]);
|
||||
}
|
||||
|
||||
if (data.language) {
|
||||
tags.push(['L', 'ISO-639-1']);
|
||||
tags.push(['l', data.language, 'ISO-639-1']);
|
||||
}
|
||||
|
||||
const media = data.media_ids?.length ? await getUnattachedMediaByIds(kysely, data.media_ids) : [];
|
||||
|
||||
const imeta: string[][] = media.map(({ data }) => {
|
||||
|
|
|
@ -100,7 +100,7 @@ async function renderStatus(event: DittoEvent, opts: RenderStatusOpts): Promise<
|
|||
sensitive: !!cw,
|
||||
spoiler_text: (cw ? cw[1] : subject?.[1]) || '',
|
||||
visibility: 'public',
|
||||
language: event.tags.find((tag) => tag[0] === 'lang')?.[1] || null,
|
||||
language: event.tags.find((tag) => tag[0] === 'l' && tag[2] === 'ISO-639-1')?.[1] || null,
|
||||
replies_count: event.event_stats?.replies_count ?? 0,
|
||||
reblogs_count: event.event_stats?.reposts_count ?? 0,
|
||||
favourites_count: event.event_stats?.reactions['+'] ?? 0,
|
||||
|
|
Loading…
Reference in New Issue