first prototype of i18n system
This commit is contained in:
parent
d3a7602fb5
commit
b4fa751345
9 changed files with 348 additions and 20 deletions
|
@ -36,6 +36,7 @@ import Button from "../material/Button.js";
|
|||
import MediaAttachmentGrid from "./MediaAttachmentGrid.js";
|
||||
import { FastAverageColor } from "fast-average-color";
|
||||
import Color from "colorjs.io";
|
||||
import { useDateFnLocale } from "../platform/i18n";
|
||||
|
||||
type TootContentViewProps = {
|
||||
source?: string;
|
||||
|
@ -170,6 +171,7 @@ function TootActionGroup<T extends mastodon.v1.Status>(
|
|||
|
||||
function TootAuthorGroup(props: { status: mastodon.v1.Status; now: Date }) {
|
||||
const toot = () => props.status;
|
||||
const dateFnLocale = useDateFnLocale()
|
||||
|
||||
return (
|
||||
<div class={tootStyle.tootAuthorGrp}>
|
||||
|
@ -187,7 +189,7 @@ function TootAuthorGroup(props: { status: mastodon.v1.Status; now: Date }) {
|
|||
}}
|
||||
/>
|
||||
<time datetime={toot().createdAt}>
|
||||
{formatRelative(toot().createdAt, props.now)}
|
||||
{formatRelative(toot().createdAt, props.now, {locale: dateFnLocale()})}
|
||||
</time>
|
||||
<span>
|
||||
@{toot().account.username}@{new URL(toot().account.url).hostname}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue