mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-26 09:54:43 +10:00
feat(pdf): roll out shared RTL layout to all templates
Introduce createRtlStyleHelpers and a single rtl flag on RenderProvider, migrate every template page to mirrored layout styles, and rename alignRight to alignEnd. Fix plain rich text rendering via PdfText paragraph renderers and map legacy Times New Roman to Times-Roman. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { defaultLocale, isLocale } from "./locale";
|
||||
import { defaultLocale, isLocale, isRTL } from "./locale";
|
||||
|
||||
describe("defaultLocale", () => {
|
||||
it("is en-US", () => {
|
||||
@@ -40,3 +40,16 @@ describe("isLocale", () => {
|
||||
expect(isLocale([])).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("isRTL", () => {
|
||||
it.each([
|
||||
["ar-SA", true],
|
||||
["he-IL", true],
|
||||
["fa-IR", true],
|
||||
["en-US", false],
|
||||
["en-GB", false],
|
||||
["fr-FR", false],
|
||||
])("returns %s → %s", (locale, expected) => {
|
||||
expect(isRTL(locale)).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -84,6 +84,6 @@ const RTL_LANGUAGES = new Set([
|
||||
]);
|
||||
|
||||
export function isRTL(locale: string): boolean {
|
||||
const language = locale.split("-")[0].toLowerCase();
|
||||
const language = locale.split("-")[0]?.toLowerCase() ?? "";
|
||||
return RTL_LANGUAGES.has(language);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user