Welcome, Guest
Please Login or Register.    Lost Password?

[Released] A Voice Chime
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: [Released] A Voice Chime
#18411
[Released] A Voice Chime 1 Year, 11 Months ago  
Voice chime: customize.org/rainlendar/skins/65669520
I am creating a voice chime that can use Chinese or American to report the time.
But at now, I have a question, How to obtain the default language of system ?

I use Rainlendar_GetOption(PATH, "UILanguage") to get what skin's language is using.
But if user setting the skin's language as "Default" (UILanguage=0), I don't know how to obtain the default language of system ? to decide use Chinese or American ?

Ooh, I just want to know that system language is "Chinese" or not ?

Thanks and hope anyone's help.

part of code:
UIlang = Rainlendar_GetOption("GlobalSettings", "UILanguage")
if UIlang == "47" or UIlang == "46" then
UI_lang = "Chinese"
else
UI_lang = "American"
end
anoob
Platinum Boarder
Posts: 504
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
Last Edit: 2013/03/06 12:38 By anoob.
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#18412
Re: How to obtain the default language of system ? 1 Year, 11 Months ago  
The os.setlocale(nil) returns the current locale but I think Rainlendar forces all lua scripts to use the 'C' locale so that probably does not work. One a bit hackish way would be to check the name of the "Program Files" folder (or something else which is accessible from the lua script). That naturally works in Windows only though.
Rainy
Moderator
Posts: 6000
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#18415
Re:How to obtain the default language of system ? 1 Year, 11 Months ago  
Rainy wrote:The os.setlocale(nil) returns the current locale but I think Rainlendar forces all lua scripts to use the 'C' locale so that probably does not work.
Thanks, the os.setlocale(nil) is working good, it really returns that what I want?

Now, the "Voice Chime" has been done. It will reported time, at each 30 minutes.
Those who are interested, please go to see the first posted to download and try, thanks.

Use way:
>> unzip voicechime.zip file
>> copy "_chime.lua" file and "chimedll" folder into Rainlendar's scripts folder (eg. C:\Program Files\Rainlendar2\scripts\)
>> refresh Rainlendar.

The VoiceClock.r2skin file is optional for install.
It will reported time, when every time user press the "Speak Now" button.

Note:
Please don't request me to add more voice dll files, because the voice dll files are not created by me, them are come from the other 3rd program,
and I don't know why? only the "Chinese.dll" & "American.dll" can work fine at Rainlendar, the other dll files are not work properly (they always speak "it's 12 am"),
but if the 3rd program is running, all voice dll files will work properly.
anoob
Platinum Boarder
Posts: 504
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
Last Edit: 2012/12/11 02:46 By anoob.
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#18417
Re:How to obtain the default language of system ? 1 Year, 11 Months ago  
Windows has a strange way to show locales.
This site is in German, but it shows many locales (also in Linux and HPUX): lua.gts-stolberg.de/os.php
In my PC, for example, it shows "Spanish_Spain.1252". It could have been "es_ES.ISO885915", but that's not my O.S.

I remember to make a chime clock 6 months ago (original link). Using that code and several wave files from an old software called "Da La Hora" (~"Give Time") delivered in a PC magazine, I created a Spanish version of the chime.
If you can't find a way to run another language within the 3rd party app, I could upload it. What do you think?
Jorge_Luis
Platinum Boarder
Posts: 795
graphgraph
User Offline Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
The administrator has disabled public write access.
 
#18418
Re:How to obtain the default language of system ? 1 Year, 11 Months ago  
Jorge_Luis wrote:Windows has a strange way to show locales. This site is in German, but it shows many locales (also in Linux and HPUX): lua.gts-stolberg.de/os.php In my PC, for example, it shows "Spanish_Spain.1252". It could have been "es_ES.ISO885915", but that's not my O.S. Thanks, this explains why Rainy say:
"I think Rainlendar forces all lua scripts to use the 'C' locale so that probably does not work."
That is, there is a need to consider the various situations.

Using that code and several wave files from an old software called "Da La Hora" (~"Give Time") delivered in a PC magazine, I created a Spanish version of the chime. If you can't find a way to run another language within the 3rd party app, I could upload it. What do you think?
Oh! If it is not too much trouble, Hope you can upload (or mail me) the complete sample, then I can study and learning.
anoob
Platinum Boarder
Posts: 504
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: TaiChung, Taiwan, R.O.C. Birthday: 02/12
The administrator has disabled public write access.
I couldn't speak English! This skin released to Customize.org(Do you want it? Click Picture) Please contact me if interested: jhg5702@gmail.com
 
#18419
Re:How to obtain the default language of system ? 1 Year, 11 Months ago  
I sent you the files to your email.
Jorge_Luis
Platinum Boarder
Posts: 795
graphgraph
User Offline Click here to see the profile of this user
Gender: Male My Rainlendar Skins Location: Argentina Birthday: 03/15
Last Edit: 2012/12/03 08:33 By Jorge_Luis.
The administrator has disabled public write access.
 
Go to topPage: 12
get the latest posts directly to your desktop