Improved the Right to Left Direction implementation for relevant languages. (#2583)

* Added support for right to left direction of bullet points in the page render and text editor

* Added right to left direction support by adding a toggle button in the layout and enhancing the css element of the page render to support it without affecting the default left to right direction

* Moved the Right to Life Direction Toggle feature to be integrated with the Languages section using locale

* change all occurrances of pl, pr, ml, mr, left, right to start/end equivalents

---------

Co-authored-by: Amruth Pillai <im.amruth@gmail.com>
This commit is contained in:
Ibrahim
2026-01-25 22:18:20 +05:00
committed by GitHub
parent 0c65612368
commit 3f55c24e36
125 changed files with 484 additions and 264 deletions
+8
View File
@@ -1,8 +1,10 @@
import { i18n, type MessageDescriptor, type Messages } from "@lingui/core";
import { msg } from "@lingui/core/macro";
import { useLingui } from "@lingui/react";
import { createIsomorphicFn, createServerFn } from "@tanstack/react-start";
import { getCookie, setCookie } from "@tanstack/react-start/server";
import Cookies from "js-cookie";
import { useMemo } from "react";
import z from "zod";
const localeSchema = z.union([
@@ -144,6 +146,12 @@ export function isRTL(locale: string): boolean {
return RTL_LANGUAGES.has(language);
}
export function useIsRTL() {
const { i18n } = useLingui();
return useMemo(() => isRTL(i18n.locale), [i18n.locale]);
}
export const getLocale = createIsomorphicFn()
.client(() => {
const locale = Cookies.get(storageKey);