It is currently March 28th, 2024, 10:13 am

Searching for weather.com Language Codes (en-US)

Our most popular Tips and Tricks from the Rainmeter Team and others
Post Reply
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Searching for weather.com Language Codes (en-US)

Post by jsmorley »

I have created a small table on our server to hold the Language Codes (i.e. en-US / fr-FR etc.) supported by https://weather.com.


The information can be accessed at:

https://admin.rainmeter.net/LanguageCodes.php


You can simply scroll or CTRL-F search in your browser to find the Language Code you want.

You can also use WebParser to add a feature to your skin allowing your users to select the language they want.


The data is returned with <tags></tags> to make it easy to parse.

<CountryName> : Name of a specific country (i.e. Romania)
<LanguageName> : Name of the language (i.e. Romanian)
<UnitName> : Units of measure (Metric / Imperial)
<LanguageCode> : The Language Code to use with weather.com (i.e. ro-RO)

Code: Select all

<CountryName>Romania</CountryName></td><td style="width: 40%;"><LanguageName>Romanian</LanguageName></td><td style="width: 10%;"><UnitName>Metric</UnitName></td><td style="width: 10%;"><span style="color:#E67E17"><LanguageCode>ro-RO</LanguageCode></span>
There are currently 181 records in the table. These are in no way ALL the Language Codes that exist, just the ones supported by weather.com.

All names are represented in the English / ASCII character set variant of the name.

Germany, not Deutschland
Japanese, not 日本語, not Nihongo

The data is sorted by CountryName, LanguageName".

To be clear, these codes when use with the URL for weather.com will control what language and units of measures the values are returned in. This has nothing to do with which location is being measured. You can return the weather for Milwaukee, Wisconsin in Arabic if you like...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ⭐ Searching for weather.com Language Codes (en-US)

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Country=india
Language=hindi

[MeasureData]
Measure=WebParser
URL=https://admin.rainmeter.net/LanguageCodes.php
RegExp=(?siU)^(.*)$

[MeasureGetEntry]
Measure=WebParser
URL=[MeasureData]
RegExp=(?siU)<CountryName>#Country#.*</CountryName>.*<LanguageName>#Language#.*</LanguageName>.*<LanguageCode>(.*)</LanguageCode>(.*)</LanguageCode>

[MeasureLanguageCode]
Measure=WebParser
URL=[MeasureGetEntry]
StringIndex=1

[MeterLanguage]
Meter=String
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
InlineSetting=Color | 197,227,255
InlinePattern=Code for (.*) in (.*) is
InlineSetting2=Case | Proper
InlinePattern2=Code for (.*) in (.*) is
InlineSetting3=Color | 159,255,159,255
InlinePattern3=.* (.*)$
Text=The Language Code for #Language# in #Country# is [MeasureLanguageCode]


1.png
Post Reply