-
-
Notifications
You must be signed in to change notification settings - Fork 63
feat(i18n): Implement runtime internationalization language support, changelog and bug fix #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
LeandroGazoli
wants to merge
1
commit into
samueljun:master
Choose a base branch
from
LeandroGazoli:multi-language-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project are documented in this file. | ||
|
|
||
| ## [7.2.1] - 2026-02-11 | ||
|
|
||
| ### Added | ||
|
|
||
| - Runtime internationalization loader (`src/utils/i18n.js`) that loads `_locales/<lang>/messages.json` dynamically. | ||
| - Language selector in the Options page allowing users to choose language (default: English). | ||
| - `t()` helper, `setLanguage()` and `applyTranslations()` functions to translate UI without page reload. | ||
| - `_locales/en` and `_locales/pt` messages include translations for UI labels and sound names. | ||
| - `CHANGELOG.md` (this file). | ||
|
|
||
| ### Changed | ||
|
|
||
| - Replaced static strings in HTML with `__MSG_...__` placeholders and added runtime substitution. | ||
| - Replaced many `browser.i18n.getMessage(...)` uses with the runtime `t(...)` helper for consistency. | ||
| - Options UI now supports dynamic language switching and persists the user's choice in settings. | ||
| - `webpack.config.js` updated to copy the `_locales` folder into `dist/` so `web-ext` can load translations. | ||
| - Cross-platform `npm start` runner added (`scripts/run-webext.js`) and improved handling for Windows and Chromium. | ||
| - `README.md` updated with Windows-specific development instructions. | ||
| - Various small updates to ensure i18n and localization work across popup, options and stats pages. | ||
|
|
||
| ### Fixed | ||
|
|
||
| - Fixed `spawn EINVAL` when running `web-ext` via `npx` on Windows by using shell invocation in the runner. | ||
| - Fixed missing localized strings in built HTML by applying runtime localization. | ||
|
|
||
| ## [7.2.0] - previous | ||
|
|
||
| - (previous release notes omitted) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| { | ||
| "extName": { | ||
| "message": "Tomato Clock - A Simple Pomodoro Timer" | ||
| }, | ||
| "extDescription": { | ||
| "message": "A simple browser extension for managing your productivity." | ||
| }, | ||
| "actionDefaultTitle": { | ||
| "message": "Tomato Clock" | ||
| }, | ||
| "cmd_start_tomato_description": { | ||
| "message": "Start a new tomato timer." | ||
| }, | ||
| "cmd_start_short_break_description": { | ||
| "message": "Start a new short break." | ||
| }, | ||
| "cmd_start_long_break_description": { | ||
| "message": "Start a new long break." | ||
| }, | ||
| "cmd_reset_timer_description": { | ||
| "message": "Reset the current timer." | ||
| }, | ||
| "confirmResetStats": { | ||
| "message": "Are you sure you want to reset your stats?" | ||
| }, | ||
| "invalidJSON": { | ||
| "message": "Invalid JSON" | ||
| }, | ||
| "tomatoesLabel": { | ||
| "message": "Tomatoes" | ||
| }, | ||
| "dateFormat": { | ||
| "message": "dddd, MMMM Do YYYY" | ||
| }, | ||
| "range_last_7_days": { | ||
| "message": "Last 7 Days" | ||
| }, | ||
| "range_this_week": { | ||
| "message": "This week" | ||
| }, | ||
| "range_last_week": { | ||
| "message": "Last week" | ||
| }, | ||
| "range_last_30_days": { | ||
| "message": "Last 30 Days" | ||
| }, | ||
| "range_this_month": { | ||
| "message": "This Month" | ||
| }, | ||
| "range_last_month": { | ||
| "message": "Last Month" | ||
| }, | ||
| "range_this_year": { | ||
| "message": "This Year" | ||
| }, | ||
| "range_last_year": { | ||
| "message": "Last Year" | ||
| }, | ||
| "sound_alarm_beep_loud_mp3": { | ||
| "message": "Alarm Beep Loud" | ||
| }, | ||
| "sound_alarm_beep_mp3": { | ||
| "message": "Alarm Beep" | ||
| }, | ||
| "sound_beep_beep_mp3": { | ||
| "message": "Beep Beep" | ||
| }, | ||
| "sound_button_mp3": { | ||
| "message": "Button" | ||
| }, | ||
| "sound_kitchen_timer_mp3": { | ||
| "message": "Kitchen Timer" | ||
| }, | ||
| "sound_timer_chime_mp3": { | ||
| "message": "Timer Chime" | ||
| }, | ||
| "sound_custom": { | ||
| "message": "Custom" | ||
| }, | ||
| "panelTitle": { | ||
| "message": "Panel - Tomato Clock" | ||
| }, | ||
| "btn_tomato": { | ||
| "message": "Tomato" | ||
| }, | ||
| "btn_short_break": { | ||
| "message": "Short Break" | ||
| }, | ||
| "btn_long_break": { | ||
| "message": "Long Break" | ||
| }, | ||
| "btn_reset": { | ||
| "message": "Reset" | ||
| }, | ||
| "label_stats": { | ||
| "message": "Stats" | ||
| }, | ||
| "optionsTitle": { | ||
| "message": "Options - Tomato Clock" | ||
| }, | ||
| "label_minutes_in_tomato": { | ||
| "message": "Minutes in Tomato" | ||
| }, | ||
| "label_minutes_in_short_break": { | ||
| "message": "Minutes in Short Break" | ||
| }, | ||
| "label_minutes_in_long_break": { | ||
| "message": "Minutes in Long Break" | ||
| }, | ||
| "label_notification_sound": { | ||
| "message": "Notification sound" | ||
| }, | ||
| "placeholder_custom_sound": { | ||
| "message": "Custom Sound" | ||
| }, | ||
| "btn_clear": { | ||
| "message": "Clear" | ||
| }, | ||
| "label_toolbar_minute_display": { | ||
| "message": "Toolbar minute display" | ||
| }, | ||
| "btn_reset_to_default": { | ||
| "message": "Reset to default" | ||
| }, | ||
| "modal_confirm_reset_title": { | ||
| "message": "Confirm Reset" | ||
| }, | ||
| "modal_confirm_reset_body": { | ||
| "message": "Are you sure you want to reset all settings to default?" | ||
| }, | ||
| "btn_cancel": { | ||
| "message": "Cancel" | ||
| }, | ||
| "btn_reset_confirm": { | ||
| "message": "Reset" | ||
| }, | ||
| "statsTitle": { | ||
| "message": "Stats - Tomato Clock" | ||
| }, | ||
| "statsHeader": { | ||
| "message": "Stats - Tomato Clock" | ||
| }, | ||
| "label_date_range": { | ||
| "message": "Date Range" | ||
| }, | ||
| "label_language": { | ||
| "message": "Language" | ||
| }, | ||
| "table_header_timer": { | ||
| "message": "Timer" | ||
| }, | ||
| "table_header_count": { | ||
| "message": "#" | ||
| }, | ||
| "label_tomatoes": { | ||
| "message": "Tomatoes" | ||
| }, | ||
| "label_short_breaks": { | ||
| "message": "Short Breaks" | ||
| }, | ||
| "label_long_breaks": { | ||
| "message": "Long Breaks" | ||
| }, | ||
| "btn_export_stats": { | ||
| "message": "Export Stats as JSON" | ||
| }, | ||
| "btn_import_stats": { | ||
| "message": "Import Stats from JSON" | ||
| }, | ||
| "btn_reset_stats": { | ||
| "message": "Reset Stats" | ||
| }, | ||
| "offscreenTitle": { | ||
| "message": "Offscreen" | ||
| }, | ||
| "lang_en": { | ||
| "message": "English" | ||
| }, | ||
| "lang_pt": { | ||
| "message": "Portuguese" | ||
| }, | ||
| "label_options": { | ||
| "message": "Options" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is a regurgitation of the git log, I'm not seeing the value of maintaining a changelog in this format.
I'm more open to the idea of maintaining a product changelog, similar to the version history on the firefox addons store https://addons.mozilla.org/en-US/firefox/addon/tomato-clock/versions/. But that should be it own pr/commit for isolated commmits.