Skip to content

Conversation

@SethFalco
Copy link
Member

@SethFalco SethFalco commented Oct 20, 2025

Adds real localization support. Up until now, we only used meta.language to set the lang attribute in the metadata of the document.

Now we'll actually use it to change how we format dates, and will slowly add languages to change how the actual sections/titles are rendered.

Currently, only English is fully supported, but we'll get Dutch fairly quickly, and likely get German, French, Bosnian, Norwegian, etc., in the near future.

A lot of the i18n code is actually just taken from gitlab.com/SethFalco/matrix-stream-alerts.

Chore

Also restructures the project so it's all maintained in a src/ directory, and we expose the render function in the root index.js file the same way we did before. This will keep the project simple to maintain as we scale up the feature set, but maintain compatibility with resume-cli.

Related

Summary by CodeRabbit

  • New Features
    • Added internationalization support with English locale
    • Introduced locale-aware date formatting with fallback for ongoing roles
    • Added Twitter/X handle detection from resume profiles
    • Improved link and markdown rendering
    • Added automatic schema upgrade for legacy resumes with backward compatibility

@coderabbitai
Copy link

coderabbitai bot commented Oct 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR restructures the module to add Project Fluent-based internationalization support, moving the render function to src/index.js and introducing locale file loading, template variable replacement for UI strings, and resume schema upgrade logic while adding @fluent/bundle and @fluent/langneg dependencies.

Changes

Cohort / File(s) Summary
Module restructuring
index.js, scripts/generate-preview.js
Moved render export from index.js to src/index.js; updated import path in generate-preview.js to reflect new source location.
Package configuration
package.json
Added dependencies @fluent/bundle and @fluent/langneg for i18n support; updated files list to include src/ and remove template/style files.
Internationalization infrastructure
src/i18n/messages.js, src/i18n/locales/en.ftl
Introduced Messages class for Fluent-based locale loading and message resolution; added English locale file with translated UI keys (contact, email, work-experience, etc.).
Rendering and templating
src/index.js, src/resume.handlebars
New async render function with Handlebars helpers for markdown, links, i18n lookups, and locale-aware date formatting; added resume schema upgrade logic; replaced hardcoded English strings in template with i18n helper calls.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant render as render(resume)
    participant FileIO as FileSystem
    participant Upgrade as upgradeOutdatedResume
    participant Messages as Messages
    participant Handlebars as Handlebars
    participant Minify as HTML Minifier

    Caller->>render: resume object
    render->>FileIO: read style.css & resume.handlebars
    FileIO-->>render: template & styles
    render->>Upgrade: upgrade resume schema
    Upgrade-->>render: upgraded resume (if needed)
    render->>Messages: new Messages().load(locale)
    Messages->>FileIO: read locale file
    FileIO-->>Messages: locale bundle
    Messages-->>render: messages instance
    render->>Handlebars: compile template<br/>(with helpers: markdown, link, i18n, date)
    Handlebars->>Handlebars: render with resume data<br/>(helpers localize & format)
    Handlebars-->>render: rendered HTML
    render->>Minify: minify HTML
    Minify-->>render: minified result
    render-->>Caller: HTML string
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

The changes introduce substantial new logic: Fluent-based i18n infrastructure with language negotiation, resume schema upgrade with multiple field mutations, Handlebars helpers with markdown parsing and locale-aware formatting, and file I/O coordination. The modifications span multiple architectural layers (module structure, dependencies, template compilation) and require careful validation of schema upgrade logic, i18n message loading, and helper behavior.

Possibly related PRs

Poem

🐰 Locales bloom across the land,
English, French, all tongues understand,
Fluent messages dance and play,
Handlebars translate each day,
A resume speaks in every way!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6456a9 and 2c6db2e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • index.js (1 hunks)
  • package.json (2 hunks)
  • scripts/generate-preview.js (1 hunks)
  • src/i18n/locales/en.ftl (1 hunks)
  • src/i18n/messages.js (1 hunks)
  • src/index.js (1 hunks)
  • src/resume.handlebars (12 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SethFalco SethFalco merged commit e0ede30 into jsonresume:main Oct 20, 2025
2 of 3 checks passed
@SethFalco SethFalco deleted the localization branch October 20, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better localization support

1 participant