feat: add bilingual support to info modal

- Added 'ui' section to cv-en.json and cv-es.json with modal translations
- Updated Go models to include UI, InfoModal, and TechStack structs
- Modified template to use JSON data instead of inline if/else statements
- Used template.HTML for Description field to allow HTML rendering
- Modal now fully supports English and Spanish translations

Translations include:
- Modal title
- Description text
- Tech stack labels (HTML5 Semántico vs Semantic HTML5, etc.)
- View source button text
This commit is contained in:
juanatsap
2025-11-09 20:59:10 +00:00
parent 1fc30f6525
commit de0c443764
4 changed files with 53 additions and 11 deletions
+7 -11
View File
@@ -297,41 +297,37 @@
</button>
<div class="info-modal-header">
<h2>{{if eq .Lang "es"}}Acerca de este CV{{else}}About this CV{{end}}</h2>
<h2>{{.CV.UI.InfoModal.Title}}</h2>
<div class="info-modal-cv-title">CV {{.CurrentYear}} - {JAMR}</div>
</div>
<div class="info-modal-body">
<p class="info-modal-description">
{{if eq .Lang "es"}}
Este CV interactivo fue construido por mí mismo con <strong>Go + HTMX</strong>, demostrando arquitectura moderna de hipermedia sin frameworks pesados de JavaScript.
{{else}}
This interactive CV was built by myself with <strong>Go + HTMX</strong>, showcasing modern hypermedia architecture without heavy JavaScript frameworks.
{{end}}
{{.CV.UI.InfoModal.Description}}
</p>
<div class="info-modal-tech">
<div class="info-tech-item">
<iconify-icon icon="mdi:language-go" width="32" height="32"></iconify-icon>
<span>Go + Hono</span>
<span>{{.CV.UI.InfoModal.TechStack.GoHono}}</span>
</div>
<div class="info-tech-item">
<iconify-icon icon="mdi:lightning-bolt" width="32" height="32"></iconify-icon>
<span>HTMX</span>
<span>{{.CV.UI.InfoModal.TechStack.HTMX}}</span>
</div>
<div class="info-tech-item">
<iconify-icon icon="mdi:language-html5" width="32" height="32"></iconify-icon>
<span>Semantic HTML5</span>
<span>{{.CV.UI.InfoModal.TechStack.HTML5}}</span>
</div>
<div class="info-tech-item">
<iconify-icon icon="mdi:language-css3" width="32" height="32"></iconify-icon>
<span>Pure CSS3</span>
<span>{{.CV.UI.InfoModal.TechStack.CSS3}}</span>
</div>
</div>
<a href="https://github.com/juanatsap/cv-site" target="_blank" rel="noopener noreferrer" class="info-modal-github">
<iconify-icon icon="mdi:github" width="24" height="24"></iconify-icon>
<span>{{if eq .Lang "es"}}Ver código fuente{{else}}View Source Code{{end}}</span>
<span>{{.CV.UI.InfoModal.ViewSource}}</span>
<iconify-icon icon="mdi:arrow-right" width="20" height="20"></iconify-icon>
</a>
</div>