Skip to content

feat(year_progress): add language selection for localized labels#641

Open
saulob wants to merge 3 commits intofatihak:mainfrom
saulob:feature/year-progress-add-language-selection
Open

feat(year_progress): add language selection for localized labels#641
saulob wants to merge 3 commits intofatihak:mainfrom
saulob:feature/year-progress-add-language-selection

Conversation

@saulob
Copy link
Copy Markdown

@saulob saulob commented Mar 28, 2026

Summary

Add language selection to the Year Progress plugin so the three UI labels are localized directly inside the plugin

This change keeps the implementation simple and self contained, with no external API, no extra dependency, and no remote translation source

What changed

  • Added a new Language setting in the plugin configuration

  • Added hardcoded locale labels for:

    • Dutch
    • English
    • French
    • German
    • Indonesian
    • Italian
    • Portuguese
    • Spanish
  • Localized only the static UI labels used by the plugin:

    • Progress
    • Done
    • Days left
  • Kept the rest of the plugin behavior unchanged

Why hardcoded

This plugin only needs a very small and stable set of short labels, so hardcoding the translations keeps it:

  • simple
  • fast
  • easy to maintain
  • fully offline
  • free from external service dependency

Why these languages

I selected a compact set of widely used languages that makes sense for an open source project with an international audience, while keeping the settings list small and practical

The goal here was to cover common languages used by many users in community projects without overcomplicating the plugin

Notes

  • No external API was added
  • No translation package was added
  • No dynamic locale detection was added
  • Only the three static labels were localized

Screenshots

Configuration screen with the new language selector

Main screen example using Portuguese labels

2026-03-28_13-48_1 2026-03-28_13-48

Copilot AI review requested due to automatic review settings March 28, 2026 16:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a self-contained language selector to the Year Progress plugin so its three static UI labels (“Progress”, “Done”, “Days left”) are rendered using plugin-localized strings.

Changes:

  • Added LOCALE_DATA translations and passed localized label strings into the render template parameters.
  • Added a plugin settings.html with a Language dropdown that persists/loads the selected language.
  • Updated the render HTML template to use {{label_*}} variables instead of hardcoded English labels.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/plugins/year_progress/year_progress.py Adds locale dictionary + injects localized labels into template params based on settings["language"].
src/plugins/year_progress/settings.html Adds Language <select> and JS to initialize it from pluginSettings.
src/plugins/year_progress/render/year_progress.html Replaces hardcoded labels with localized template variables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/plugins/year_progress/year_progress.py Outdated
Comment thread src/plugins/year_progress/settings.html Outdated
@saulob
Copy link
Copy Markdown
Author

saulob commented Mar 28, 2026

All Copilot review comments addressed

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.

2 participants