I'm not able to make it works. I found only one way replace
Substitute="New":"#@#MoonPhaseIcons\0.png","Waxing Crescent":"#@#MoonPhaseIcons\1.png",
with:
Substitute="New(in wanted lang, Neu, Nový,...)":"#@#MoonPhaseIcons\0.png","Waxing Crescent(in wanted lang)":"#@#MoonPhaseIcons\1.png", etc...
In main ini file, but this is not user friendly or write the same parameter in every language with ";" Maybe anybody find better way. All other measures are working. Also I made to work RWF6 and RWF5 with icons from 6, but those moon phases are too hard for me.
It is currently May 2nd, 2024, 11:37 pm
Weather not working?
-
- Posts: 25
- Joined: March 6th, 2020, 9:38 am
Re: Weather not working?
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 16195
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather not working?
I have to admit I didn't follow too closely this discussion, but the language code of the Czech language is not cz-CZ, but cs-CZ. First thing which indicated that cz-CZ is wrong was the fact that with this variable, beside getting all strings in English, I also got the temperatures in the imperial scale, which for sure is not used in the Czech Republic. Then I checked the list of language codes and found the error, described above.
-
- Posts: 25
- Joined: March 6th, 2020, 9:38 am
Re: Weather not working?
Sorry I have cs-CZ i made a mistake here. But on picture are how it looks in many lang I tested on picture are czech, german, english and french. Used codes: cs-CZ, en-GB, de-DE, fr-FRbalala wrote: ↑March 9th, 2020, 4:53 pm I have to admit I didn't follow too closely this discussion, but the language code of the Czech language is not cz-CZ, but cs-CZ. First thing which indicated that cz-CZ is wrong was the fact that with this variable, beside getting all strings in English, I also got the temperatures in the imperial scale, which for sure is not used in the Czech Republic. Then I checked the list of language codes and found the error, described above.
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 16195
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather not working?
And is there any problem with any of those languages?
-
- Posts: 25
- Joined: March 6th, 2020, 9:38 am
Re: Weather not working?
No. As you can see in english moon phases picture is shown, but if you switch to any other language it doesn't matter which, moon phases picture is not shown, but translations are ok. I think that problem is, that it isn't coded same as forecasts but here are syntax below:
Code: Select all
[MeasureMoonPhaseIcon]
Measure=String
String=[@MoonDay1PhaseName]
DynamicVariables=1
Substitute="New":"#@#MoonPhaseIcons\0.png","Waxing Crescent":"#@#MoonPhaseIcons\1.png","First Quarter":"#@#MoonPhaseIcons\2.png","Waxing Gibbous":"#@#MoonPhaseIcons\3.png","Full":"#@#MoonPhaseIcons\4.png","Waning Gibbous":"#@#MoonPhaseIcons\5.png","Last Quarter":"#@#MoonPhaseIcons\6.png","Waning Crescent":"#@#MoonPhaseIcons\7.png"
Last edited by balala on March 9th, 2020, 6:11 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting code snippets. It's the </> button.
Reason: Please use <code> tags whenever are you posting code snippets. It's the </> button.
-
- Rainmeter Sage
- Posts: 16195
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather not working?
Now I see what are you talking about. Yep, you're right.
Should get the appropriate file path and name on the [MeasureMoonPhaseIcon] measure, no matter of the set language. Working with this I finally figured out two different, a little bit complicated solutions, but at least they are working:
- We should extend the substitution made on the previously mentioned [MeasureMoonPhaseIcon] measure. Add a RegExpSubstitute=1 option to the measure and modify its Substitute option to the following one: Substitute="(?i)full moon in your language":"Full","(?i)first quarter in your language":"First Quarter","(?i)last quarter in your language":"Last Quarter","(?i)new moon in your language":"New","(?i)waxing crescent in your language":"Waxing Crescent","(?i)waxing gibbous in your language":"Waxing Gibbous","(?i)waning gibbous in your language":"Waning Gibbous","(?i)waning crescent in your language":"Waning Crescent","New":"#@#MoonPhaseIcons\0.png","Waxing Crescent":"#@#MoonPhaseIcons\1.png","First Quarter":"#@#MoonPhaseIcons\2.png","Waxing Gibbous":"#@#MoonPhaseIcons\3.png","Full":"#@#MoonPhaseIcons\4.png","Waning Gibbous":"#@#MoonPhaseIcons\5.png","Last Quarter":"#@#MoonPhaseIcons\6.png","Waning Crescent":"#@#MoonPhaseIcons\7.png".
Note the substitutions added before the previous first substitution (marked red above). Obviously you have to replace the full moon in your language, first quarter in your language (and so on) string with the appropriate translations in your language. - This second solution seem much more elegant. Starting from the original, unmodified code, add the following measures:
Modify the String option of the [MeasureMoonPhaseIcon] measure to the following one: String=[MoonDay1PhaseName] (instead of the original String=[@MoonDay1PhaseName]).
Code: Select all
[EntireSiteSuperParent] Measure=WebParser URL=https://weather.com/en-GB/weather/today/l/#LocationCode# DecodeCharacterReference=1 UpdateRate=#UpdateRate# LogSubstringErrors=0 RegExp=(?siU)^(.*)$ StringIndex=1 [MoonParent] Measure=WebParser Group=Parents URL=[EntireSiteSuperParent] StringIndex=1 RegExp=(?siU)"vt1dailyForecast":\[{"validDate":"(.*)",.*"moonIcon":"(.*)","moonPhrase":"(.*)","moonrise":"(.*)","moonset":"(.*)",.*{"validDate":"(.*)",.*"moonIcon":"(.*)","moonPhrase":"(.*)","moonrise":"(.*)","moonset":"(.*)",.*{"validDate":"(.*)",.*"moonIcon":"(.*)","moonPhrase":"(.*)","moonrise":"(.*)","moonset":"(.*)",.*{"validDate":"(.*)",.*"moonIcon":"(.*)","moonPhrase":"(.*)","moonrise":"(.*)","moonset":"(.*)",.*{"validDate":"(.*)",.*"moonIcon":"(.*)","moonPhrase":"(.*)","moonrise":"(.*)","moonset":"(.*)",.*{"validDate":"(.*)",.*"moonIcon":"(.*)","moonPhrase":"(.*)","moonrise":"(.*)","moonset":"(.*)", [MoonDay1PhaseName] Measure=WebParser URL=[MoonParent] StringIndex=3
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Weather not working?
Balala offered a working alternative, but here is one that does not require new measures...dasxardas wrote: ↑March 9th, 2020, 6:05 pm No. As you can see in english moon phases picture is shown, but if you switch to any other language it doesn't matter which, moon phases picture is not shown, but translations are ok. I think that problem is, that it isn't coded same as forecasts but here are syntax below:
Code: Select all
[MeasureMoonPhaseIcon] Measure=String String=[@MoonDay1PhaseName] DynamicVariables=1 Substitute="New":"#@#MoonPhaseIcons\0.png","Waxing Crescent":"#@#MoonPhaseIcons\1.png","First Quarter":"#@#MoonPhaseIcons\2.png","Waxing Gibbous":"#@#MoonPhaseIcons\3.png","Full":"#@#MoonPhaseIcons\4.png","Waning Gibbous":"#@#MoonPhaseIcons\5.png","Last Quarter":"#@#MoonPhaseIcons\6.png","Waning Crescent":"#@#MoonPhaseIcons\7.png"
Replace the above measure with this to display the moon phases... my first mod did not consider other languages, this uses the moon phase data from TWC.
Code: Select all
[MeasureMoonPhaseIcon]
Measure=String
String=[@MoonDay1PhaseIcon]
DynamicVariables=1
Substitute="N":"#@#MoonPhaseIcons\0.png","WXC":"#@#MoonPhaseIcons\1.png","FQ":"#@#MoonPhaseIcons\2.png","WXG":"#@#MoonPhaseIcons\3.png","F":"#@#MoonPhaseIcons\4.png","WNG":"#@#MoonPhaseIcons\5.png","LQ":"#@#MoonPhaseIcons\6.png","WNC":"#@#MoonPhaseIcons\7.png"
You do not have the required permissions to view the files attached to this post.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 16195
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather not working?
Indeed much more elegant and simple. Beside this, mine is sucks.eclectic-tech wrote: ↑March 9th, 2020, 8:36 pm Balala offered a working alternative, but here is one that does not require new measures...
Replace the above measure with this to display the moon phases... my first mod did not consider other languages, this uses the moon phase data from TWC.
Congrats...
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Weather not working?
Yours simply overlooked that the skin already had parsed the info, while I just didn't take the time to test it before...
No good deed goes unpunished!
I updated my previous post with a corrected version. Here...
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 7190
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather not working?
I'm not sure if this is more "elegant" ... but yes, it's a bit smarter, as it takes advantage of the "duplicate" moon phase string (aka its abbreviation) in the TWC data. Such tricks can similarly be applied to Phrase and Narrative, if needed in a specific scenario, for example.