Skip to content

Commit

Permalink
feat: ✨ Add brainrot locale
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed Dec 7, 2024
1 parent 2ceee48 commit c3a2e5e
Show file tree
Hide file tree
Showing 26 changed files with 355 additions and 36 deletions.
3 changes: 1 addition & 2 deletions components/notes/actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ 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 { languageTag } from "~/paraglide/runtime";
import { SettingIds } from "~/settings";
import { confirmModalService } from "../modals/composable";
import Menu from "./menu.vue";
Expand Down Expand Up @@ -143,7 +142,7 @@ const unreblog = async () => {
const numberFormat = (number = 0) =>
number !== 0
? new Intl.NumberFormat(languageTag(), {
? new Intl.NumberFormat(getLanguageTag(), {
notation: "compact",
compactDisplay: "short",
maximumFractionDigits: 1,
Expand Down
3 changes: 1 addition & 2 deletions components/notes/content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ 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 { languageTag } from "~/paraglide/runtime";
import { type BooleanSetting, SettingIds } from "~/settings";
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
import Attachments from "./attachments.vue";
Expand Down Expand Up @@ -78,7 +77,7 @@ const isOverflowing = computed(() => {
const characterCount = plainContent?.length;
const formattedCharacterCount = characterCount
? new Intl.NumberFormat(languageTag()).format(characterCount)
? new Intl.NumberFormat(getLanguageTag()).format(characterCount)
: undefined;
</script>

Expand Down
3 changes: 1 addition & 2 deletions components/notes/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import type {
UseTimeAgoUnitNamesDefault,
} from "@vueuse/core";
import { AtSign, Globe, Lock, LockOpen } from "lucide-vue-next";
import { languageTag } from "~/paraglide/runtime";
import { SettingIds } from "~/settings";
import Avatar from "../profiles/avatar.vue";
import SmallCard from "../profiles/small-card.vue";
Expand Down Expand Up @@ -90,7 +89,7 @@ const timeAgo = useTimeAgo(createdAt, {
invalid: "",
} as UseTimeAgoMessages<UseTimeAgoUnitNamesDefault>,
});
const fullTime = new Intl.DateTimeFormat(languageTag(), {
const fullTime = new Intl.DateTimeFormat(getLanguageTag(), {
dateStyle: "medium",
timeStyle: "short",
}).format(createdAt);
Expand Down
3 changes: 1 addition & 2 deletions components/profiles/profile-stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<script lang="ts" setup>
import { CalendarDays } from "lucide-vue-next";
import * as m from "~/paraglide/messages.js";
import { languageTag } from "~/paraglide/runtime";
const { creationDate } = defineProps<{
creationDate: Date;
Expand All @@ -34,7 +33,7 @@ const { creationDate } = defineProps<{
followingCount: number;
}>();
const formattedCreationDate = new Intl.DateTimeFormat(languageTag(), {
const formattedCreationDate = new Intl.DateTimeFormat(getLanguageTag(), {
month: "long",
year: "numeric",
}).format(creationDate);
Expand Down
2 changes: 1 addition & 1 deletion components/sidebars/account-switcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<DropdownMenuGroup v-if="identity">
<DropdownMenuItem :as="NuxtLink" :href="`/@${identity.account.username}`">
<BadgeCheck />
{{ m.factual_awful_hare_drip() }}
{{ m.factual_arable_jurgen_endure() }}
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
Expand Down
4 changes: 2 additions & 2 deletions components/sidebars/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ const route = useRoute();
<Separator orientation="vertical" class="mr-2 h-4" />
<Breadcrumb v-if="route.meta.breadcrumbs">
<BreadcrumbList>
<template v-for="(breadcrumb, index) of route.meta.breadcrumbs">
<template v-for="(breadcrumb, index) of route.meta.breadcrumbs()">
<BreadcrumbItem class="hidden md:block">
<component :is="breadcrumb.href ? BreadcrumbLink : BreadcrumbPage" :href="breadcrumb.href">
{{ breadcrumb.text }}
</component>
</BreadcrumbItem>
<BreadcrumbSeparator v-if="index !== (route.meta.breadcrumbs.length - 1)"
<BreadcrumbSeparator v-if="index !== (route.meta.breadcrumbs().length - 1)"
class="hidden md:block" />
</template>
</BreadcrumbList>
Expand Down
2 changes: 1 addition & 1 deletion composables/Language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { SettingIds } from "~/settings";
export const useLanguage = () => {
const lang = useSetting(SettingIds.Language);

return computed(() => lang.value.value as "en" | "fr");
return computed(() => lang.value.value as "en" | "fr" | "en-rot");
};
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare module "#app" {
interface PageMeta {
breadcrumbs?: {
breadcrumbs?: () => {
text: string;
href?: string;
}[];
Expand Down
Loading

0 comments on commit c3a2e5e

Please sign in to comment.