mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-16 16:19:47 +10:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user