-
Notifications
You must be signed in to change notification settings - Fork 62
Add preset time dropdowns for work, rest, and loop durations #134
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
base: master
Are you sure you want to change the base?
Conversation
…inese and enhance dropdown styling
…yboard event handlers
Two issues to mention:
|
…ple languages and enhance dropdown item display for time presets
|
I have fixed the problem and it could now support multi-language. |
Feedbacks:
|
// For Chinese languages, use specific characters | ||
const currentLang = store.get('i18n') || 'en'; | ||
if (currentLang === 'zh-CN') { | ||
minutes = '分钟'; |
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.
Hard-coded strings like this is not preferred and does not support fourth locale support even if there is not such a thing as for now.
@@ -394,5 +394,6 @@ | |||
"can-redo-msg": "是否需要对当前段时间进行重新计时?", | |||
"custom": "自定义", | |||
"custom-notify-sound": "自定义提示音", | |||
"input-url": "输入路径" | |||
"input-url": "输入路径", | |||
"minutes": "minutes-[zh-CN]" |
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.
Redundant string is not OK for all three language jsons.
})(); | ||
|
||
// Apply custom colors to dropdown elements | ||
$('body').append( |
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.
If you search in all code base you will find that dark mode is already supported in somewhere else so you shall not implement it again.
if (!i18n.__('minutes')) { | ||
// Define a mapping for full words based on language | ||
const minutesMapping = { | ||
'zh-CN': '分钟', // Simplified Chinese |
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.
Also redundant here. You shall never hard-code anything but should always refer from locales/*.json using i18n.__("") syntax.
Add preset time dropdowns for work, rest, and loop durations
Overview
This PR introduces a new user interface improvement to wnr that allows users to quickly select common time durations through dropdown menus with a scrollable interface, rather than manually typing values each time.
Features
UI Changes