It is currently March 28th, 2024, 1:03 pm

7DayWeatherCom

Weather skins
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 7DayWeatherCom

Post by jsmorley »

TallShultzy wrote: June 15th, 2020, 2:06 pm I wasn't sure whether the skin had to be vetted before it was released.
Is the Administrative Region the state in the US?
The "null" could be tested

The screen could show
Birmingham
United Kingdom
or
Birmingham
Alabama, USA
No, your skin is your skin. You don't need anyone's permission or approval to modify and release a skin that has a Creative Commons license. You just need to release it with the same Creative Commons license.

I was just chewing on the fact that I don't display the location in my skin, even though it certainly isn't a bad idea.

Yeah, Administrative Region in the US is the "state". That is super-important information in the US, but of no meaning or value in the UK. It isn't done, and probably would be politically incorrect to use:

Birmingham, England, United Kingdom

Once Brexit causes Scotland, Wales and Northern Ireland to spin off on their own, maybe then... Where is Edward Longshanks when you need him? ;-)

I probably need to IfMatch for "null", and take the appropriate action.
TallShultzy
Posts: 62
Joined: March 30th, 2016, 5:02 pm

Re: 7DayWeatherCom

Post by TallShultzy »

We are just as fiercely "nationalistic" in the UK as "Cardiff, Wales, UK" would be acceptable and not frowned upon. I was thinking more about the "real estate used". An abbreviation on the country might be ok as these are universally accepted.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 7DayWeatherCom

Post by jsmorley »

TallShultzy wrote: June 15th, 2020, 2:27 pm We are just as fiercely "nationalistic" in the UK as "Cardiff, Wales, UK" would be acceptable and not frowned upon. I was thinking more about the "real estate used". An abbreviation on the country might be ok as these are universally accepted.
Certainly. I think your example of

Birmingham
United Kingdom
or
Birmingham
Alabama, USA

Is about right.
TallShultzy
Posts: 62
Joined: March 30th, 2016, 5:02 pm

Re: 7DayWeatherCom

Post by TallShultzy »

You might have to reduce the font size to get "North Carolina, USA" to fit although "State of Rhode Island and Providence Plantations" will be a bit more tricky :Whistle
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 7DayWeatherCom

Post by jsmorley »

Well, Mooselookmeguntic, Maine, US is going to be a problem as well.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: 7DayWeatherCom

Post by xenium »

jsmorley wrote: June 15th, 2020, 1:53 pm For instance, Birmingham doesn't even include any Administrative Region. It's just null.

I don't want to display Birmingham, , United Kingdom

On the other hand

Springfield, United States of America

Is really meaningless. There is a city or town of "Springfield" in probably every state in the union...
The solution is to use a single comma:
displayName adminDistrictCode, country

When there is adminDistrictCode:
Chicago IL, United States of America

When adminDistrictCode is null:
Birmingham, United Kingdom
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 7DayWeatherCom

Post by jsmorley »

xenium wrote: June 15th, 2020, 3:10 pm The solution is to use a single comma:
displayName adminDistrictCode, country

When there is adminDistrictCode:
Chicago IL, United States of America

When adminDistrictCode is null:
Birmingham, United Kingdom
Well, not quite...

When there is adminDistrictCode:
Chicago IL, United States of America

When adminDistrictCode is null:
Birmingham , United Kingdom
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: 7DayWeatherCom

Post by xenium »

jsmorley wrote: June 15th, 2020, 3:12 pm Well, not quite...

When there is adminDistrictCode:
Chicago IL, United States of America

When adminDistrictCode is null:
Birmingham , United Kingdom
I don't think it bothers someone that there is a small space between the city and comma...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 7DayWeatherCom

Post by jsmorley »

xenium wrote: June 15th, 2020, 3:23 pm I don't think it bothers someone that there is a small space between the city and comma...
Really? I can never unsee it.. ;-)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: 7DayWeatherCom

Post by jsmorley »

So what I did was:

ContextTitle=#ContextLocationString#

Code: Select all

[MeasureFormatLocation]
Measure=String
Group=Weather
String=[@LocationAdminDistrict]
DynamicVariables=1
IfMatch=^$
IfMatchMode=1
IfMatchAction=[!SetVariable ContextLocationString "[@LocationName], [@LocationCountry]"]
IfNotMatchAction=[!SetVariable ContextLocationString "[@LocationName], [@LocationAdminDistrict], [@LocationCountryCode]"]
That gives me

Birmingham, Alabama, US

and

Birmingham, United Kingdom


This works because ContextTitle and ContextAction in [Rainmeter] are always "dynamic", as they are resolved when clicked.


1.jpg

2.jpg


I need the IfMatchMode=1 because when the skin is first loaded, none of the values are populated yet, so the IfMatch is "true" and it sets the string with all null values. It won't come back and try again until the IfMatch changes to "false" and then back to "true". Another approach is to set a FinishAction on the "super parent" that "enables" this measure, but I'm hesitant to put things in the template files that are skin specific. I can live with the IfMatchMode=1. It's just setting a variable.
Post Reply