It is currently May 19th, 2019, 7:45 am

FormatLocale=Local

Changes made during the Rainmeter 3.2 beta cycle.
User avatar
jsmorley
Developer
Posts: 19245
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

FormatLocale=Local

jsmorley » February 22nd, 2015, 3:01 pm

We have added an option value of Local to the FormatLocale option on the Time measure. This will cause the output format to automatically use the date / time "locale" language and format set in Windows for the machine the skin is running on, rather than defaulting to a standard platform-agnostic "English" representation.

E.g. FormatLocale=Local

If you want to have a skin that displays the date, one of the things you might want is to have it display in the "language" of the user that is running the skin.

Before these changes to the Time measure, that generally meant some hideously long and convoluted Substitute statements, for things like "month name" or "day name". You would then need those for every "language" you wanted to support, or expect the end-user to modify the Substitutes to "translate" them to the desired language. This could also mean that the skin .ini file would have to be encoded as UTF-16 to support their character set.

With the new FormatLocale option for the Time measure, you can have a skin with a formatted date, and it can automatically "translate" to the language of the user's system. Pretty much any language. Neither you, nor they, need to do anything to make it work. Also, since the actual characters are not embedded in the skin .ini code, no particular encoding is needed.

Code: Select all

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

[MeasureDayOfWeek]
Measure=Time
FormatLocale=Local
Format=%A
DynamicVariables=1

[MeasureMonthDay]
Measure=Time
FormatLocale=Local
Format=%B %#d
DynamicVariables=1

[MeasureYear]
Measure=Time
FormatLocale=Local
Format=%Y
DynamicVariables=1

[MeterDayOfWeek]
Meter=String
MeasureName=MeasureDayOfWeek
FontSize=40
FontColor=255,255,255,255
SolidColor=0,0,0,1
StringCase=Upper
AntiAlias=1

[MeterMonthDay]
Meter=String
MeasureName=MeasureMonthDay
X=([MeterDayOfWeek:W])
Y=0R
StringAlign=Right
FontSize=20
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
DynamicVariables=1

[MeterYear]
Meter=String
MeasureName=MeasureYear
X=([MeterDayOfWeek:W])
Y=0R
StringAlign=Right
FontSize=30
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
DynamicVariables=1
The key is that FormatLocale=Local option, which will get the "locale" setting in Windows for the machine the skin is running on. Then you just build your display meters, and Bingo, the skin is automatically "translated".

On an English user's system:
eng.jpg
On a Dutch user's system:
dutch.jpg
On a French user's system:
fra.jpg
On a Hebrew user's system:
hebrew.jpg
On a Russian user's system:
Russian.jpg
On a Turkish user's system:
turkish.jpg
You do not have the required permissions to view the files attached to this post.
regs
Posts: 1
Joined: December 26th, 2015, 9:53 am

Re: FormatLocale=Local

regs » December 26th, 2015, 10:02 am

This really too complicated for non geeks. Should be in settings UI. And language and regional standards should be picked up automatically respectively of system settings.



Additionally would be even better to offer widgets some standardized settings format that would be customizable through settings UI.

I.e. several types - boolean, lists, integers and strings. And list them in settings as checkboxes, comboboxes, listboxes and textboxes.