diff --git a/packages/manfred-common/src/doc-parts/profile-section/profile-section.mapper.spec.ts b/packages/manfred-common/src/doc-parts/profile-section/profile-section.mapper.spec.ts index 352a9e85..f5fd66fc 100644 --- a/packages/manfred-common/src/doc-parts/profile-section/profile-section.mapper.spec.ts +++ b/packages/manfred-common/src/doc-parts/profile-section/profile-section.mapper.spec.ts @@ -330,4 +330,5 @@ describe('Testing profile-section.mapper.ts', () => { }); }); }); + export {}; diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/about-me-section.ejs b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/about-me-section.ejs index 30e9595c..9d61e836 100644 --- a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/about-me-section.ejs +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/about-me-section.ejs @@ -4,7 +4,7 @@ -

Sobre mi

+

<%- labels.ABOUT_ME_HEADING %>

<%= profile?.description %>

diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/about-me-section.part.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/about-me-section.part.ts index bfc3b41c..e22d918a 100644 --- a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/about-me-section.part.ts +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/about-me-section.part.ts @@ -1,16 +1,22 @@ import ejs from 'ejs'; import { ProfileSectionVm, mapFromMacCvToProfileSectionVm } from '@lemoncode/manfred-common/profile-section'; -import { ManfredAwesomicCV } from '@/model'; +import { ManfredAwesomicCV, Language, Settings } from '@/model'; +import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const'; +import { getLabels } from './labels'; import aboutMeSection from './about-me-section.ejs?raw'; -export const generateAboutMeSection = (cv: ManfredAwesomicCV): string => { +export const generateAboutMeSection = (cv: ManfredAwesomicCV, settings: Settings): string => { const profileSectionVm = mapFromMacCvToProfileSectionVm(cv); - return generateAboutMeSectionInner(profileSectionVm); + return generateAboutMeSectionInner(profileSectionVm, settings.language); }; -const generateAboutMeSectionInner = (profileSectionVm: ProfileSectionVm): string => { +const generateAboutMeSectionInner = ( + profileSectionVm: ProfileSectionVm, + language: Language = ISO_SPANISH_LANGUAGE +): string => { const rootObject = { profile: profileSectionVm, + labels: getLabels(language), }; return ejs.render(aboutMeSection, rootObject); diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-english-labels.const.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-english-labels.const.ts new file mode 100644 index 00000000..7d85fc96 --- /dev/null +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-english-labels.const.ts @@ -0,0 +1,5 @@ +import { AboutMeLabels } from './about-me-labels.model'; + +export const englishAboutMeLabels: AboutMeLabels = { + ABOUT_ME_HEADING: 'About me', +}; diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-labels.model.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-labels.model.ts new file mode 100644 index 00000000..ff37c169 --- /dev/null +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-labels.model.ts @@ -0,0 +1,3 @@ +export interface AboutMeLabels { + ABOUT_ME_HEADING: string; +} diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-spanish-labels.const.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-spanish-labels.const.ts new file mode 100644 index 00000000..3aa4c27d --- /dev/null +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/about-me-spanish-labels.const.ts @@ -0,0 +1,5 @@ +import { AboutMeLabels } from './about-me-labels.model'; + +export const spanishAboutMeLabels: AboutMeLabels = { + ABOUT_ME_HEADING: 'Sobre mí', +}; diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/index.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/index.ts new file mode 100644 index 00000000..cfad900e --- /dev/null +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/about-me-section/labels/index.ts @@ -0,0 +1,15 @@ +import { Language } from '@/model'; +import { AboutMeLabels } from './about-me-labels.model'; +import { spanishAboutMeLabels } from './about-me-spanish-labels.const'; +import { englishAboutMeLabels } from './about-me-english-labels.const'; + +export const getLabels = (language: Language): AboutMeLabels => { + switch (language) { + case 'es': + return spanishAboutMeLabels; + case 'en': + return englishAboutMeLabels; + default: + throw new Error(`Language not supported: ${language}`); + } +}; diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/header-section/header-section.ejs b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/header-section/header-section.ejs index 35a0caaf..9bfff9f8 100644 --- a/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/header-section/header-section.ejs +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/header-section/header-section.ejs @@ -1,5 +1,5 @@ <%_ if (profile && profile !== 'undefined') { -%> - <%_ if (profile.avatar && profile.avatar.link) { -%> + <%_ if (profile.avatar) { -%> photo cv <%_ } -%>
@@ -11,7 +11,7 @@

<%= profile?.surnames %>

<%= profile?.title %>

- <%_ if (profile.regionLocation && profile.countryLocation && profile.regionLocation !== 'undefined' && profile.countryLocation !== 'undefined') { -%> + <%_ if (profile.regionLocation) { -%>
@@ -29,86 +29,6 @@

<%= profile?.regionLocation %>, <%= profile?.countryLocation %>

<%_ } -%> - <%_ if (profile.relevantLinks && profile.relevantLinks.length !== 0) { -%> -
<%_ } -%> diff --git a/packages/manfred2html/src/engine/cv-x-wing-squadron/index.ts b/packages/manfred2html/src/engine/cv-x-wing-squadron/index.ts index 34fe7773..f9e288e9 100644 --- a/packages/manfred2html/src/engine/cv-x-wing-squadron/index.ts +++ b/packages/manfred2html/src/engine/cv-x-wing-squadron/index.ts @@ -18,7 +18,7 @@ export const exportManfredJsonToCVXWingHTML = (manfredJsonContent: ManfredAwesom const headerElementEnd = generateHeaderElementEnd(); const headerSection = generateHeaderSection(manfredJsonContent); const mainElementStart = generateMainElementStart(); - const aboutMeSection = generateAboutMeSection(manfredJsonContent); + const aboutMeSection = generateAboutMeSection(manfredJsonContent, settings); const mainElementEnd = generateMainElementEnd(); const languageSection = generateLanguageSection(manfredJsonContent, settings); return `