Page 1 of 1 1
Topic Options
#203853 - 2011-11-25 10:50 PM display @day and @month in other language
cividan Offline
Fresh Scripter

Registered: 2011-11-18
Posts: 25
Loc: Quebec, Canada
Is there a way to display @day and @month in other language than english, I went around the problem by defining a variable for $day and $month and set them to something weird and doing a series of if which is not pretty.

 Code:

CLS
?
?
$day="blabla"
$month="blabla"

If @DAY = "Monday" 
	$day = "Lundi"
EndIf
If @DAY = "Tuesday" 
	$day = "Mardi"
EndIf
If @DAY = "wednesday" 
	$day = "Mercredi"
EndIf
If @DAY = "thursday" 
	$day = "Jeudi"
EndIf
If @DAY = "Friday" 
	$day = "Vendredi"
EndIf
If @DAY = "Saturday" 
	$day = "Samedi"
EndIf
If @DAY = "Sunday" 
	$day = "Dimanche"
EndIf
If @MONTH = "january"
	$month = "janvier"
EndIf
If @MONTH = "february"
	$month = "Février"
EndIf
If @MONTH = "march"
	$month = "mars"
EndIf
If @MONTH = "april"
	$month = "avril"
EndIf
If @MONTH = "may"
	$month = "mai"
EndIf
If @MONTH = "june"
	$month = "juin"
EndIf
If @MONTH = "july"
	$month = "juillet"
EndIf
If @MONTH = "august"
	$month = "août"
EndIf
If @MONTH = "september"
	$month = "septembre"
EndIf
If @MONTH = "october"
	$month = "octobre"
EndIf
If @MONTH = "november"
	$month = "novembre"
EndIf
If @MONTH = "december"
	$month = "décembre"
EndIf

If $month= "blabla"
	$month= @MONTH
EndIf

If $day= "blabla"
	$day= @DAY
EndIf	

Color g+/n
? "================================================================="
? "Bienvenue sur le réseau de notre entreprise."
;? "Today is " + @DAY + ", " + @MONTH + " " + @MDAYNO + "."
? "Aujourd'hui nous sommes " "" + $day + " le " + @MDAYNO + " " + $month 



Edited by cividan (2011-11-25 10:51 PM)

Top
#203854 - 2011-11-25 11:32 PM Re: display @day and @month in other language [Re: cividan]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
thought it would be localized \:o

anyways, to shorten your current code:
 Code:
$days = "","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"
$curdayname=$days[@wdayno]
_________________________
!

download KiXnet

Top
#203855 - 2011-11-26 05:54 AM Re: display @day and @month in other language [Re: cividan]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: cividan
...which is not pretty.
Someday you will look back at this and laugh about how lonk reduced 21 lines of your code to 2.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#203856 - 2011-11-26 01:55 PM Re: display @day and @month in other language [Re: Les]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that would be nice. I've been embarrassed by some of the earliest posts I made... and some newer ones too \:\)
_________________________
!

download KiXnet

Top
#203860 - 2011-11-28 03:59 PM Re: display @day and @month in other language [Re: Lonkero]
cividan Offline
Fresh Scripter

Registered: 2011-11-18
Posts: 25
Loc: Quebec, Canada
Maybe one day I will laught at this but for now I'm too happy to receive help in my baisc programming mind to think about that.
Thanks for the code I will test and come back with feedback!

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.053 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org