Commit graph

18 commits

Author SHA1 Message Date
Johannes Millan
9be6bf7c27 fix(plugins): initialize current language on plugin mount
Fixed i18n to fetch and use the current language when the plugin
initializes, instead of always defaulting to English. Now the plugin
will show the correct language immediately on first load, and also
update reactively when the language changes.

Changes:
- Added getCurrentLanguage() call in useTranslate initialization
- Changed onMount to createEffect for reactive language loading
- Updated both App.tsx and ProcrastinationInfo.tsx to use createEffect
- Applied fixes to both procrastination-buster and boilerplate
- Added debug logging to troubleshoot language change events

This fixes the issue where plugins always started in English regardless
of the user's selected language.
2026-01-16 22:34:50 +01:00
Johannes Millan
de264aff48 fix(plugins): fix i18n message protocol for iframe communication
Fixed the message passing between plugin iframes and plugin.ts to use
the proper PLUGIN_MESSAGE/PLUGIN_MESSAGE_RESPONSE protocol instead of
custom messages. This ensures translations and other messages are
correctly routed through the plugin bridge.

Changes:
- Updated useTranslate to use PLUGIN_MESSAGE type
- Listen for PLUGIN_MESSAGE_RESPONSE instead of custom response
- Wrap message in { type, payload } structure
- Updated plugin.ts to read from message.payload
- Added debug logging for troubleshooting
- Applied fixes to both procrastination-buster and boilerplate
2026-01-16 22:34:50 +01:00
Johannes Millan
eb120baf1b feat(plugins): add i18n support to boilerplate-solid-js
- Add useTranslate() hook for reactive translations in SolidJS
- Include example translation files (en.json, de.json)
- Update Vite plugin to copy i18n folder during build
- Add i18n message handlers to plugin.ts
- Demonstrate i18n usage in App.tsx with ~10 translation keys
- Update documentation with comprehensive i18n guide
- Add i18n to features list in main plugin-dev README

The boilerplate now provides a complete working example of multi-language
plugin support, making it easy for developers to create internationalized
plugins.
2026-01-16 22:34:50 +01:00
Trang Le
b618a70727 import type PluginHooks 2025-10-20 09:14:04 +07:00
Trang Le
e72de51819 rewrite registerShortcut 2025-09-11 13:16:58 +07:00
Trang Le
1f8361c735 remove onDestroy because it doesn't exist in PluginAPI 2025-09-11 13:14:47 +07:00
Trang Le
bcc1f7a36f rewrite onMessage handler 2025-09-11 13:14:12 +07:00
Trang Le
f417ea5d49 fix anyTaskUpdate hook 2025-09-11 12:55:35 +07:00
Trang Le
6f788e8007 register hooj ANY_TASK_UPDATE 2025-09-10 18:01:10 +07:00
Trang Le
9344f30247 remove unused members imported from plugin-api 2025-09-10 17:47:13 +07:00
Trang Le
ed18216cc8 fix registration of task update hook 2025-09-10 17:28:43 +07:00
Trang Le
61d7223113 fix config options for registering header button 2025-09-10 17:26:10 +07:00
Trang Le
970b1c9294 fix plugin logging 2025-09-10 17:25:33 +07:00
Trang Le
48e0f788cf fix registration of task complete hook 2025-09-10 17:25:05 +07:00
Trang Le
c435edd4e2 fix config options for registerHeaderButton and registerMenuEntry 2025-09-10 17:14:01 +07:00
Trang Le
ec2467bf66 change from PluginInterface to PluginAPI 2025-09-10 17:09:08 +07:00
Johannes Millan
4c94eeb578 feat: add open sans as default font 2025-09-04 18:30:09 +02:00
Johannes Millan
d4d81bf511 feat(plugin-api): create foundational plugin API package
- Add @super-productivity/plugin-api package with TypeScript definitions
- Define core plugin interfaces, types, and manifest structure
- Add plugin hooks system for event-driven architecture
- Create plugin API type definitions and constants
- Add documentation and development guidelines
2025-06-27 18:13:19 +02:00