cividan
(Fresh Scripter)
2011-11-25 10:50 PM
display @day and @month in other language

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 



LonkeroAdministrator
(KiX Master Guru)
2011-11-25 11:32 PM
Re: display @day and @month in other language

thought it would be localized \:o

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


Les
(KiX Master)
2011-11-26 05:54 AM
Re: display @day and @month in other language

 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.


LonkeroAdministrator
(KiX Master Guru)
2011-11-26 01:55 PM
Re: display @day and @month in other language

that would be nice. I've been embarrassed by some of the earliest posts I made... and some newer ones too \:\)

cividan
(Fresh Scripter)
2011-11-28 03:59 PM
Re: display @day and @month in other language

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!