mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ⬆️ Update Inlang JS to v2
This commit is contained in:
parent
826f3c89b7
commit
f41908a3a7
11 changed files with 136 additions and 139 deletions
|
|
@ -28,6 +28,7 @@ import { Ellipsis, Heart, Quote, Repeat, Reply } from "lucide-vue-next";
|
|||
import { toast } from "vue-sonner";
|
||||
import { Button } from "~/components/ui/button";
|
||||
import * as m from "~/paraglide/messages.js";
|
||||
import { getLocale } from "~/paraglide/runtime";
|
||||
import { SettingIds } from "~/settings";
|
||||
import { confirmModalService } from "../modals/composable";
|
||||
import Menu from "./menu.vue";
|
||||
|
|
@ -144,7 +145,7 @@ const unreblog = async () => {
|
|||
|
||||
const numberFormat = (number = 0) =>
|
||||
number !== 0
|
||||
? new Intl.NumberFormat(getLanguageTag(), {
|
||||
? new Intl.NumberFormat(getLocale(), {
|
||||
notation: "compact",
|
||||
compactDisplay: "short",
|
||||
maximumFractionDigits: 1,
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import type { Attachment, Emoji, Status } from "@versia/client/types";
|
|||
import { TriangleAlert } from "lucide-vue-next";
|
||||
import { Button } from "~/components/ui/button";
|
||||
import * as m from "~/paraglide/messages.js";
|
||||
import { getLocale } from "~/paraglide/runtime";
|
||||
import { type BooleanSetting, SettingIds } from "~/settings";
|
||||
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
|
||||
import Attachments from "./attachments.vue";
|
||||
|
|
@ -77,7 +78,7 @@ const isOverflowing = computed(() => {
|
|||
|
||||
const characterCount = plainContent?.length;
|
||||
const formattedCharacterCount = characterCount
|
||||
? new Intl.NumberFormat(getLanguageTag()).format(characterCount)
|
||||
? new Intl.NumberFormat(getLocale()).format(characterCount)
|
||||
: undefined;
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ import type {
|
|||
UseTimeAgoUnitNamesDefault,
|
||||
} from "@vueuse/core";
|
||||
import { AtSign, Globe, Lock, LockOpen } from "lucide-vue-next";
|
||||
import { getLocale } from "~/paraglide/runtime";
|
||||
import { SettingIds } from "~/settings";
|
||||
import Avatar from "../profiles/avatar.vue";
|
||||
import SmallCard from "../profiles/small-card.vue";
|
||||
|
|
@ -89,7 +90,7 @@ const timeAgo = useTimeAgo(createdAt, {
|
|||
invalid: "",
|
||||
} as UseTimeAgoMessages<UseTimeAgoUnitNamesDefault>,
|
||||
});
|
||||
const fullTime = new Intl.DateTimeFormat(getLanguageTag(), {
|
||||
const fullTime = new Intl.DateTimeFormat(getLocale(), {
|
||||
dateStyle: "medium",
|
||||
timeStyle: "short",
|
||||
}).format(createdAt);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { CalendarDays } from "lucide-vue-next";
|
||||
import * as m from "~/paraglide/messages.js";
|
||||
import { getLocale } from "~/paraglide/runtime";
|
||||
|
||||
const { creationDate } = defineProps<{
|
||||
creationDate: Date;
|
||||
|
|
@ -33,8 +34,8 @@ const { creationDate } = defineProps<{
|
|||
followingCount: number;
|
||||
}>();
|
||||
|
||||
const formattedCreationDate = new Intl.DateTimeFormat(getLanguageTag(), {
|
||||
const formattedCreationDate = new Intl.DateTimeFormat(getLocale(), {
|
||||
month: "long",
|
||||
year: "numeric",
|
||||
}).format(creationDate);
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue