It is currently December 3rd, 2022, 11:50 am

Enigma Google Calendar Patch

A package of skins with a "theme" or by a single author
Nicknightfly
Posts: 8
Joined: October 21st, 2022, 9:48 am

Re: Enigma Google Calendar Patch

Post by Nicknightfly »

balala wrote: October 21st, 2022, 5:55 pm Please help us to can help you, when you1re asking for help. For instance, which skin of the package are you working with? And what do you mean by "localize in other languages this part"? Would you want to get localized times? Sorry but at least for me, it's not really clear what you want.
Hi balala, I have this skin: https://visualskins.com/skin/google-calendar, stand alone google calendar skin, with the attached Reader.lua (in txt format). I want to translate months names, days names in italian. Tia
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 14758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Enigma Google Calendar Patch

Post by balala »

Nicknightfly wrote: October 22nd, 2022, 7:57 am I want to translate months names, days names in italian.
The simplest way to do this is in my opinion, to add so many Time measures as many articles you have in the skin, one for each. These measures can be easier made to get translated the month and day names.
For tryout, for first let's work ONLY with translating the date of first article. For this, please do the followings:
  • Add the following measure to the code of the skin:

    Code: Select all

    [Measure1Date]
    Measure=Time
    Format=%#H:%M %A %b %d
    TimeStamp=#Item1Date#
    TimeStampFormat=%I:%M %p %A %b %d
    FormatLocale=it-IT
    DynamicVariables=1
    (I added this right before the [ItemWhen1] measure, but you can add it anywhere).
  • Modify the [ItemWhen1] meter as it follows:

    Code: Select all

    [ItemWhen1]
    Meter=STRING
    MeasureName=Measure1Date
    Group=FeedData
    MeterStyle=StyleReaderSubtext
    Text=%1
    As you can see, I replaced the Text option and added the MeasureName option.
Does it work as expected? If it does, you can modify the same way the other String meters as well, and add the appropriate Time measures. If you can't get it to properly work, please let me know.
Nicknightfly
Posts: 8
Joined: October 21st, 2022, 9:48 am

Re: Enigma Google Calendar Patch

Post by Nicknightfly »

balala wrote: October 22nd, 2022, 7:24 pm The simplest way to do this is in my opinion, to add so many Time measures as many articles you have in the skin, one for each. These measures can be easier made to get translated the month and day names.
For tryout, for first let's work ONLY with translating the date of first article. For this, please do the followings:
  • Add the following measure to the code of the skin:

    Code: Select all

    [Measure1Date]
    Measure=Time
    Format=%#H:%M %A %b %d
    TimeStamp=#Item1Date#
    TimeStampFormat=%I:%M %p %A %b %d
    FormatLocale=it-IT
    DynamicVariables=1
    (I added this right before the [ItemWhen1] measure, but you can add it anywhere).
  • Modify the [ItemWhen1] meter as it follows:

    Code: Select all

    [ItemWhen1]
    Meter=STRING
    MeasureName=Measure1Date
    Group=FeedData
    MeterStyle=StyleReaderSubtext
    Text=%1
    As you can see, I replaced the Text option and added the MeasureName option.
Does it work as expected? If it does, you can modify the same way the other String meters as well, and add the appropriate Time measures. If you can't get it to properly work, please let me know.
Thank you for the answer, but in my skin there isn't any [ItemWhen1] measure, or maybe I'm not so good to understand the corrections you propose me. If you open the attached Reader.lua(modified in .txt) you can see and maybe you can help me to understand where I must insert your modifications. I tried to insert them but the skin remain stuck in loading. Sorry for my bad english
User avatar
SilverAzide
Rainmeter Sage
Posts: 2175
Joined: March 23rd, 2015, 5:26 pm

Re: Enigma Google Calendar Patch

Post by SilverAzide »

Nicknightfly wrote: October 23rd, 2022, 1:13 pm Thank you for the answer, but in my skin there isn't any [ItemWhen1] measure, or maybe I'm not so good to understand the corrections you propose me. If you open the attached Reader.lua(modified in .txt) you can see and maybe you can help me to understand where I must insert your modifications. I tried to insert them but the skin remain stuck in loading. Sorry for my bad english
Balala's suggestions were to insert the changes into the skin itself, not the Lua code. You cannot localize the Lua code, it is English only unfortunately, so the code cannot be changed as you are trying to do (actually, if localization worked in Rainmeter's implementation of Lua, you would not need to change anything). You can localize Rainmeter measures, so that is what balala was suggesting.
Gadgets Wiki GitHub More Gadgets...
Nicknightfly
Posts: 8
Joined: October 21st, 2022, 9:48 am

Re: Enigma Google Calendar Patch

Post by Nicknightfly »

SilverAzide wrote: October 23rd, 2022, 3:35 pm Balala's suggestions were to insert the changes into the skin itself, not the Lua code. You cannot localize the Lua code, it is English only unfortunately, so the code cannot be changed as you are trying to do (actually, if localization worked in Rainmeter's implementation of Lua, you would not need to change anything). You can localize Rainmeter measures, so that is what balala was suggesting.
Thank you, I don't know well how to programming rainmeter, only some basic things. Your explanation is much clear for a newbie like me!
Nicknightfly
Posts: 8
Joined: October 21st, 2022, 9:48 am

Re: Enigma Google Calendar Patch

Post by Nicknightfly »

Nicknightfly wrote: October 23rd, 2022, 1:13 pm Thank you for the answer, but in my skin there isn't any [ItemWhen1] measure, or maybe I'm not so good to understand the corrections you propose me. If you open the attached Reader.lua(modified in .txt) you can see and maybe you can help me to understand where I must insert your modifications. I tried to insert them but the skin remain stuck in loading. Sorry for my bad english
After the explanation of "Silverazide" I managed to change language, I have to enter both measures for each event on the calendar (Measure1Date for Item1Date -Measure2Date for Item21Date, etc), but something is wrong, there are 2 more days in each event. The number of the day is correct and also the month, but for the days of the week it does not work, the events of Monday appear with the date Wednesday, those of Tuesday with the date Thursday and so on. If you can help me to correct the issue i really appreciate. TIA
Last edited by Nicknightfly on October 23rd, 2022, 7:50 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 14758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Enigma Google Calendar Patch

Post by balala »

Nicknightfly wrote: October 23rd, 2022, 6:07 pm After the explanation of "Silverazide" I managed to change language, something is wrong, every event in calendar have the same date lunedì(monday) 01 gen!
I suppose you've forgot is either to change the Item1Date variable into the [Measure2Date], [Measure3Date] (and so on) measures to TimeStamp=#Item2Date#, TimeStamp=#Item3Date# and so on, or to modify the measure name into the newly added MeasureName options of the [ItemWhen2], [ItemWhen3] (and so on) meters (these options obviously have to be MeasureName=Measure2Date, MeasureName=Measure3Date and so on). Or both...
Which one did you forget?
Nicknightfly
Posts: 8
Joined: October 21st, 2022, 9:48 am

Re: Enigma Google Calendar Patch

Post by Nicknightfly »

balala wrote: October 23rd, 2022, 6:53 pm I suppose you've forgot is either to change the Item1Date variable into the [Measure2Date], [Measure3Date] (and so on) measures to TimeStamp=#Item2Date#, TimeStamp=#Item3Date# and so on, or to modify the measure name into the newly added MeasureName options of the [ItemWhen2], [ItemWhen3] (and so on) meters (these options obviously have to be MeasureName=Measure2Date, MeasureName=Measure3Date and so on). Or both...
Which one did you forget?
I made the change you suggest for each event on the calendar (Measure1Date for Item1Date -Measure2Date for Item2Date, etc), but something is wrong with the year and consequently the days of the week. I added %Y to verify and the year displayed is 1900. If you can help me to correct the issue i really appreciate. TIA
Nicknightfly
Posts: 8
Joined: October 21st, 2022, 9:48 am

Re: Enigma Google Calendar Patch

Post by Nicknightfly »

Nicknightfly wrote: October 23rd, 2022, 10:17 pm I made the change you suggest for each event on the calendar (Measure1Date for Item1Date -Measure2Date for Item2Date, etc), but something is wrong with the year and consequently the days of the week. I added %Y to verify and the year displayed is 1900. If you can help me to correct the issue i really appreciate. TIA

I resolved adding %y at TimeStampFormat=%I:%M %p %A %b %d %y
You are really helpful, thank you again.
User avatar
balala
Rainmeter Sage
Posts: 14758
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Enigma Google Calendar Patch

Post by balala »

Nicknightfly wrote: October 23rd, 2022, 10:17 pm I made the change you suggest for each event on the calendar (Measure1Date for Item1Date -Measure2Date for Item2Date, etc), but something is wrong with the year and consequently the days of the week. I added %Y to verify and the year displayed is 1900. If you can help me to correct the issue i really appreciate. TIA
Nicknightfly wrote: October 23rd, 2022, 10:41 pm I resolved adding %y at TimeStampFormat=%I:%M %p %A %b %d %y
You are really helpful, thank you again.
I'm surprised if you had to add the %y parameter to the TimeStampFormat options, but if you got it working this way, it's good, I believe. Glad if it's working well.