It is currently March 28th, 2024, 9:24 pm

lua question

Discuss the use of Lua in Script measures.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: lua question

Post by balala »

Yes, you was right that I forgot to replace some lines in the original script. But I'm glad if finally you could make it to work well.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: lua question

Post by jsmorley »

This should keep you busy for basically the rest of your life dvo... ;-)

https://forum.rainmeter.net/viewtopic.php?p=123416#p123416
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: lua question

Post by jsmorley »

dvo,

Try changing the URL in the skin .ini to:

URL=https://wxdata.weather.com/wxdata/weather/local/#LocationCode#?cc=*&unit=#UnitOfMeasure#&dayf=1&locale=nl_NL

That should cause the wxdata feed to return the "conditions text" in Dutch.

I'm not convinced this could easily be made language-neutral by just setting up tables to replace all the elements with strings that can easily be translated. While this is true of the basic elements, like the numbers, and the names of days of the week and names of months, and the weather "conditions" can be returned in many different languages by wxdata.weather.com, the way things are "spoken" (in a sense) are pretty aggressively English in nature in this, and in fact pretty aggressively American-English. While it might be possible (you certainly have made a good start) to modify the Lua to change the structure of how things are presented in your language, as well as translate the stuff that makes sense in tables, I'm not sure it could easily be made generic.

A simple example is the fact that at 2:30 I would say "Half past two" and you would say "Half three". That is not a translation, but an "exception", and I suspect there are many of them in the course of this for different countries, regions, languages, cultures, and even generations of age. Hell, in the UK, a guy in another town 20 miles away can sound like a "damn foreigner" to you.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: lua question

Post by jsmorley »

"It is impossible for an Englishman to open his mouth without making some other Englishman despise him,"
-- George Bernard Shaw
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: lua question

Post by jsmorley »

dvo wrote:http://flyinghyrax.deviantart.com/art/Elementary-2-0-426588102

this skin just has a translator built in to it ? :D :o
and even you in the credits :rolmfao:
Sure, but that is just brute-force translation. That suite of skins doesn't really have to be too concerned about how things are expressed in a colloquial fashion by different cultures.

Anyway, my Lua is open for anyone to modify as they see fit. While it is programming, you will find that Lua is pretty easy compared to other programming languages.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: lua question

Post by jsmorley »

Even the simple numbers are not as straightforward as all that when you are spelling them out and not using numerals...

English: fifty-six
Spanish: cincuenta y seis
French: cinquante six
Italian: cinquantasei
German: sechsundfünfzig
Dutch: zesenvijftig

If I go to Google Translate and put this:

it's seven minutes to eleven in the morning
on monday, the sixteenth of may
the weather is sunny
it's fairly cool at fifty-five degrees

and translate it to Dutch, I get:

het zeven voor elf in de ochtend
Op maandag , de zestiende mei
het is zonnig
het is vrij koel ' vijfenvijftig graden

While the only Dutch I know is "Vertrouw nooit een Duitser", I'm betting that is not even close to how you would express the same thing.