shells-dw / loupedeck-worldclock

World Clock Plugin for the Loupedeck
MIT License
8 stars 3 forks source link

Calendar week #3

Closed Vipale closed 1 year ago

Vipale commented 1 year ago

Hey there,

calendar week is always showing the following:

Calendar Week 4

So no translation and week is not changing.

Cheers

shells-dw commented 1 year ago

Hi Vipale, sorry for the late response, been busy and away with actual work 😉

Works for me just fine on MacOS and Windows, I'm using it since I wrote it. First, try to remove and re-add the button/function. Maybe something got stuck or messed up 🤷‍♂️ If that doesn't work:

Vipale commented 1 year ago

Hi shells-dw, no worries.

(I am using German)


UPDATE: Installation is working after a reboot. But calendar week is still bugged for me. FYI other actions ask for area and city, if I add them, calendar week doesnt

shells-dw commented 1 year ago

No clue why that function wouldn't be working for you. Are you using Windows or Mac? Which version of the OS? If Windows, is it an English base version with German LIP or anything else that might be... uncommon? Like English (or non-German) Windows version and German Loupedeck or something thereabouts.

The localization code/process used by the calendar week function is exactly the same as for every other function, so if the others are localized, this one should be too - and even if the localization file would be missing the DE entry and it reverts to default EN, it would still show the correct week number and not be stuck on 4. (EDIT: is it localized on the selection list on the right? Where you pull it from?)edit/ Can't make sense of why it wouldn't. There is no part that would save or store anything, it's read from the system during runtime, so if it can't read anything (useful), it shouldn't show anything, so no clue where this week 4 would come from to be honest.

The plugin writes a log to %localappdata%\Loupedeck\Logs\plugin_logs named WorldClock.log which doesn't hold much log unless something goes wrong, so if there's anything other than Dynamic action loaded and Plugin loaded kind of entries, please attach the log here. I've looked at the code, completely wiped all buttons and reinstalled the plugin with the version from here and it just works (on Windows 10, 11 and MacOS Ventura) 🤷‍♂️ I'm using German as system and Loupedeck language as well. Everything is fine for me (and has been for the last 2 months since I added it) 🤔

As per the other remarks: Installation of plugins is sometimes a bit bugged with the Loupedeck, it sometimes doesn't delete the plugin root folder where it stores plugins when you uninstall a plugin and then doesn't check if the folder is empty during reinstall, but instead just assumes the plugin would be installed and refuses to do anything else. It seems to happen regardless of which plugin is about to be (un)installed, but as you figured out already, it's usually fixed with a PC restart (mostly restarting Loupedeck itself should be sufficient though) - but I sometimes had to manually delete the folder too.

Calendar Week (and day of the year and stuff like that) don't have the location selection. It's reading the time (and timezone) information from the local machine. I figured this kind of data is not really useful for converting to other time zones and trying to mess with that over all the different calendar systems that exist through out the world is beyond my scope for that. Generally it's the same calendar week everywhere in the world (especially for the scope of calendar targeting a "week", it doesn't matter if it starts on Friday, Saturday, Sunday or Monday - at least not enough for me to try and f with all that for that single function). I rather just have it show the local information for what it's presumably used 99% of the time anyway.

Vipale commented 1 year ago

It is localized on the right side "Kalenderwoche (lokale Zeit)"

day of the year and days left are working perfectly. (correct day and localized)

I noticed one thing: I tried to reinstall again. After uninstalling I found a worldclock file in the LocalizationCache folder which I deleted. It was not recreated after installation and adding some actions.

Maybe there is something that isn't cleaned up correctly when the plugin is uninstalled and I have some messed up entry somewhere, Or version 1.3.0 on release isn't the same version you are using locally?

shells-dw commented 1 year ago

So same as me basically, except for the location. Does Switzerland have a different time/date format than Germany? No, right? DD.MM.YYYY? Is Windows set to German/Switzerland for its time/date settings? That's a thing I didn't think of... I doubt it would make a difference, as the localization depends on the setting in Loupedeck, which only knows German, but who knows... I'd look into it, if you set it to that.

At least my testing machine is still Windows 10, my main dev box is 11. So nothing specific in the log (note also, that the log is overwritten with every Loupedeck start)? If the weekday button would've been unable to pick the correct German localization "KW" and reverted to the english default, it would have put a line in the logfile, despite all that week 4 business... very strange. I start to suspect that something's messed up in the Loupedeck App somewhere. Have you tried creating a fresh Workspace (Arbeitsbereich) and see if that fixes it? I believe Loupedeck stores plugin buttons and associated settings on workspace-level, so if there's something f-ed up, it might be fixed in a new workspace.

I noticed one thing: I tried to reinstall again. After uninstalling I found a worldclock file in the LocalizationCache folder which I deleted. It was not recreated after installation and adding some actions.

Loupedeck works in mysterious ways sometimes. My plugin doesn't create that, that's something the Loupedeck software does. I would assume it is created once you changed the language of the Loupedeck UI and restarted the Loupedeck Services, but I'm not sure. I have that file too. Only thing my plugin does, is read out the locale code from the Loupedeck software during initialization of the plugin (yeah, could improve to detect changes on the fly, but haven't had time to do that yet), then I handle my own localization, basically. So whatever it creates, I doubt it's anything important - but it's some binary file I can't easily read 🤷‍♂️ . Loupedeck also sometimes keeps buttons and their settings after a plugin is uninstalled, and sometimes it doesn't. Sometimes it deletes them during reinstall and sometimes they just function again after the plugin is reinstalled, don't know where this is saved at all - but that might be something that happened and left this weekday function in a broken state, hence my idea to try a new Workspace and see what happens. Long story short - only files I have influence in writing is the plugin itself (Plugins\WorldClock), potential settings and data (PluginData and PluginSettings) which I do not use for this plugin and the plugin logfile (Logs\plugin_logs\WorldClock.log), I don't write anything else anywhere with that plugin - so if there is, Loupedeck is doing things. Maybe there is something that isn't cleaned up correctly when the plugin is uninstalled and I have some messed up entry somewhere, Or version 1.3.0 on release isn't the same version you are using locally?

Could be. A plugin doesn't have any saying in the installation/uninstallation process. That's handled by the Loupedeck Control software. I used a newer dev version on my Windows 11 box, but installed the very version that's here when I wiped and reinstalled it today. Also Mac and Windows 10 run 1.3.0 too, so it's not that.

Sorry I'm not more helpful here, but I'm having a hard time imagining what could be going on there, as I can't reproduce it. :-/

Vipale commented 1 year ago

I did some further testing. Using a new workspace didn't change anything. But using a new main profile did. In there the action worked as expected showing KW 11. So something is messed up in my main profile. Any ideas how to fix that? Otherwise I would have to rebuild the profile from scratch, as duplicating the profile did not help.

Thanks for the help, btw

shells-dw commented 1 year ago

Wow, crazy. Never had that before! I don't know how/where this is stored, it's not somewhere obvious and given the amount of binary files Loupedeck creates, I would assume it's somewhere in there hence not really accessible by us end-users. During testing I add every button and function for different timezones on a seperate workspace and as mentioned above, sometimes Loupedeck wipes them all from the device when installing a new version which (obviously) kind of sucks. So in case you find out... let me know 😆

You can export your profile though. You could try to export, delete and reimport the profile, maybe (Ijust a shot in the dark, as said, never had that case) there is some sort of consistency check that might repair or drop whatever is messed up. Maybe it works - and if it doesn't, it's still probably worth a try before wiping it all...

No worries.

Vipale commented 1 year ago

I tried to export, delete and reimport, nothing changed. But one thing did: "reset symbol to standard" and after that everything is working as expected. No idea why this was messed up as I did not change anything.

shells-dw commented 1 year ago

lol, wouldn't have come up with that one... Nice catch! I mean in theory... I kind of dynamically create the symbol every second to show whatever a button shows (it's actually a drawed image of sorts in the background which is drawn and refreshed every second), but I'm with you - no clue how it could get stuck to a point where it doesn't update anymore when the plugin code asks it to and there's absolutely nothing that fixed it other than completely wiping the profile (or resetting the symbol that is supposed to be reset every second by the code anyway) is beyond me. Well, the Loupedeck software works in mysterious ways sometimes.

Anyway, I'm glad you figured it out! I'll keep it in mind in case someone else has the same issue and look at the code again if I can maybe reset a symbol every time a function is put on the Loupedeck, not sure off the top of my head if that's possible, but I'll look into it - and thanks for reporting back.

Cheers!