Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

fix(templates): align RTL headings and correct British spelling

Amruth Pillai45c2d845dca3
diff --git a/apps/web/locales/en-GB.po b/apps/web/locales/en-GB.po
index 9d2c3647c..476cad238 100644
--- a/apps/web/locales/en-GB.po
+++ b/apps/web/locales/en-GB.po
@@ -10367,7 +10367,7 @@ msgstr "Single-column set like a magazine feature: a large display name under an
#: src/dialogs/resume/template/data.ts
msgid "Single-column Wall Street style with a centered header and ruled section headings."
-msgstr "Single-column Wall Street style with a centered header and ruled section headings."
+msgstr "Single-column Wall Street style with a centred header and ruled section headings."
#: src/dialogs/resume/template/data.ts
msgid "Single-column with a magenta left border accent; compact and efficient for entry-level or internship applications."
diff --git a/packages/pdf/src/templates/shared/section-header-alignment.test.tsx b/packages/pdf/src/templates/shared/section-header-alignment.test.tsx
index ab4f0db16..a5e00034a 100644
--- a/packages/pdf/src/templates/shared/section-header-alignment.test.tsx
+++ b/packages/pdf/src/templates/shared/section-header-alignment.test.tsx
@@ -41,7 +41,7 @@ const fixture = (): ResumeData => {
};
const renderText = async (data: ResumeData) => {
- const element = createElement(ResumeDocument, { data, template: "onyx" }) as unknown as Parameters<
+ const element = createElement(ResumeDocument, { data, template: data.metadata.template }) as unknown as Parameters<
typeof renderToBuffer
>[0];
let bytes: Uint8Array = new Uint8Array();
@@ -82,3 +82,27 @@ describe("optional experience and education header fields (#3338)", () => {
expectTrailingAlignment(items);
});
});
+
+describe.each(["persian", "onyx"] as const)("%s section heading direction", (template) => {
+ it.each(["en-US", "ar-SA"])("keeps headings at the reading edge with and without icons in %s", async (locale) => {
+ for (const hideSectionIcons of [false, true]) {
+ const data = fixture();
+ data.metadata.template = template;
+ data.metadata.page.locale = locale;
+ data.metadata.page.hideSectionIcons = hideSectionIcons;
+ data.sections.experience.title = "Experience";
+ data.sections.education.title = "Education";
+ const items = await renderText(data);
+ for (const title of ["Experience", "Education"]) {
+ const heading = findText(items, title);
+ if (locale === "ar-SA") {
+ expect(heading.transform[4] + heading.width, `${title}, icons hidden: ${hideSectionIcons}`).toBeGreaterThan(
+ 530,
+ );
+ } else {
+ expect(heading.transform[4], `${title}, icons hidden: ${hideSectionIcons}`).toBeLessThan(60);
+ }
+ }
+ }
+ });
+});
diff --git a/packages/pdf/src/templates/shared/sections.tsx b/packages/pdf/src/templates/shared/sections.tsx
index 76dc4ef01..682b85361 100644
--- a/packages/pdf/src/templates/shared/sections.tsx
+++ b/packages/pdf/src/templates/shared/sections.tsx
@@ -181,7 +181,6 @@ const SECTION_ITEM_PLACEHOLDER_KEYS = [
] as const;
const defaultSectionHeadingContainerStyle = {
- flexDirection: "row",
alignItems: "flex-start",
columnGap: 4,
} satisfies Style;
@@ -399,7 +398,7 @@ const SectionShell = ({ sectionId, title, showHeading = true, children }: Sectio
{...resolvedPdfFlowProps(sectionHeadingResolved)}
style={composeStyles(
sectionHeadingStyle,
- defaultSectionHeadingContainerStyle,
+ { ...defaultSectionHeadingContainerStyle, flexDirection: createRtlStyleHelpers(data.rtl).row },
sectionHeadingContainerStyle,
sectionHeadingResolved.style,
)}