Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CHANGELOG.md
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)
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,36 @@ npm run watch:firefox
npm run watch:chrome
```

4. In a separate terminal, run the following command to start a clean clean browser instance with live reloading (https://github.com/mozilla/web-ext):
4. In a separate terminal, run the following command to start a clean browser instance with live reloading (https://github.com/mozilla/web-ext).

- On Windows (PowerShell):

```powershell
$env:FIREFOX_PATH = 'C:\\Program Files\\Mozilla Firefox\\firefox.exe'
npm run start
```

- On Windows (Command Prompt):

```cmd
set FIREFOX_PATH=C:\\Program Files\\Mozilla Firefox\\firefox.exe
npm run start
```

- On macOS / Linux (if Firefox is in the default location or on PATH):

```sh
npm run start
npm run start:firefox
```

- To run against Chromium/Chrome (when installed):

```sh
npm run start:chrome
```

The `start` script uses `scripts/run-webext.js` and will attempt to auto-detect a local Firefox installation; set the `FIREFOX_PATH` environment variable if your Firefox is in a non-standard location.

### Updating the version number

Run the following command with the appropriate `npm version {patch/minor/major}` to bump the package.json version based on [semver](http://semver.org/):
Expand Down
185 changes: 185 additions & 0 deletions _locales/en/messages.json
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"
}
}
Loading
Loading