×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?
6

Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

(OP)
or has that to be programmed .
I know, that sounds not international, but....
as one could transform by "set date german" it could be that a setting exists like "set cdow() german (french, italy etc.")
I did not find it.
How do you manage that?

English German

Monday - Montag
Tuesday - Dienstag
Wednesday - Mittwoch
Thursday - Donnerstag
Friday - Freitag
Saturday - Samstag
Sunday - Sonntag


January - Januar
February - Februar
March - März
April - April
May - Mai
June - Juni
July - Juli
August - August
September - September
October - Oktober
November - November
December - Dezember

Peace worldwide - it starts here...

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Hi,

I work with ARRAYS. Sketch of code below.

CODE -->

LOCAL laDays[7,2]

laDays[1,1] = "Monday"
laDays[1,2] = "Montag"

laDays[2,1] = "Tuesday"
laDays[2,2] = "Dienstag"

laDays[3,1] = "Wednesday"
laDays[3,2] = "Mittwoch"

...

? laDays(ASCAN(laDays, CDOW(DATE())), 2) 

hth

MarK

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Hi,

Below the code of a fully working CDOW() translation procedure. I added this method to my base form class and call it with TRCdow(dMyDate, cMyLanguageCode) - dMyDate is any date whereas cMyLanguageCode is "FR", "DE" or "LU". I have a similar method for the months.

CODE -->

PARAMETERS tdDate, tcLanguage

IF PARAMETERS() != 2

	= MESSAGEBOX("Please call developer", 16, "CDOW Translation")

ELSE 

	LOCAL liLCode as Integer, liRow as Integer 
	LOCAL ARRAY laDays[7, 4]

	laDays[1,1] = "Monday"
	laDays[1,2] = "Lundi"
	laDays[1,3] = "Montag"
	laDays[1,4] = "Meindeg"

	laDays[2,1] = "Tuesday"
	laDays[2,2] = "Mardi"
	laDays[2,3] = "Dienstag"
	laDays[2,4] = "Densdeg"

	laDays[3,1] = "Wednesday"
	laDays[3,2] = "Mercredi"
	laDays[3,3] = "Mittwoch"
	laDays[3,4] = "Mettwoch"

	laDays[4,1] = "Thursday"
	laDays[4,2] = "Jeudi"
	laDays[4,3] = "Donnerstag"
	laDays[4,4] = "Donneschdeg"

	laDays[5,1] = "Friday"
	laDays[5,2] = "Vendredi"
	laDays[5,3] = "Freitag"
	laDays[5,4] = "Freideg"

	laDays[6,1] = "Saturday"
	laDays[6,2] = "Samedi"
	laDays[6,3] = "Samstag"
	laDays[6,4] = "Samsdeg"

	laDays[7,1] = "Sunday"
	laDays[7,2] = "Dimanche"
	laDays[7,3] = "Sonntag"
	laDays[7,4] = "Sonndeg"

	IF TYPE("tdDate") != "D"
		tdDate = DATE()
	ENDIF 

	IF TYPE("tcLanguage") = "C"
		liLCode = ICASE(tcLanguage = "FR", 2, tcLanguage = "DE", 3, tcLanguage = "LU", 4, 1)
	ELSE
		liLCode = 1
	ENDIF 

	liRow = ASUBSCRIPT(laDays, ASCAN(laDays, CDOW(tdDate), 1, -1, 1, 1), 1)

	RETURN laDays(liRow, liLCode)
ENDIF 

hth

MarK

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Isn't this done automatically by the German resource file? If you include VFP9rdeu.dll in your run-time distribution, you should get all the English-language strings translated into German. I'm not sure about this, but it might be worth checking.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Hi Mike,

Maybe, but afaik I'm not able to have all three VFP9r*.DLL (DEU, ENU, FRA) active at the same time. Furthermore there is no "VFP9rLUX". In our multi-language situation I need however the CDOW() awa the CMONTH() in English, in French, in Luxembourgish and in German.

BTW do you have a VFP9rSCO.DLL ? wink

MarK

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Mark, of course you are right about only having one VFP9r*.DLL active at a time. In that case, your custom routine is just what's needed.

In any case, I'm not sure if these DLLs affect the output of things like CDOW(). Perhaps they are only for things like "Yes / No / Cancel".

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Hi Mike,

Quote (Mike)


In any case, I'm not sure if these DLLs affect the output of things like CDOW().

I checked, they do - but since only one VFP9r*.DLL can be active at a time, you'll have to rely on custom routines in a multi-language environment.

MarK

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

(OP)
Thank you very much, MM (=Mark & Mike).
Your considerations help me a lot to create a program
in which the German names for calendar days and months appear.
For me it is not a problem to live with the names that VFP offers, but this is not the case with all friends, e.g. if they never had English at school.

Stay healthy.

Klaus

Peace worldwide - it starts here...

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

I agree, Klaus. We shouldn't impose foreign languages on our users just for the convenience of the software.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

by coincidence (?) Doug Hennig just posted how to do this via dotNet and system.globalization on his blog

hth

n

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Hi,

...

and a demo with the translated days and months. Run the code. Enjoy.

CODE -->

PUBLIC goForm

goForm = CREATEOBJECT("MyForm")
goForm.Show()

READ EVENTS

CLOSE ALL
CLEAR ALL 

**********

DEFINE CLASS MyForm as Form
	Width = 540
	Height = 360
	MinWidth = This.Width
	MinHeight = This.Height
	MaxWidth = This.Width
	Caption = "Multilingual form"
	AutoCenter = .T.
	ShowTips = .T.
	Themes = .F.
	
	ADD OBJECT lblMLCDoW as Label WITH ;
		Top = 36, ;
		Left = 144, ;
		AutoSize = .T., ;
		Caption = CDOW(DATE()) + " - " + CMONTH(DATE())		

	ADD OBJECT lblLanguage as Label WITH ;
		Top = 36, ;
		Left = 60, ;
		AutoSize = .T., ;
		Caption = "Language"		

	ADD OBJECT cboLanguage AS ComboBox WITH ;
		Top = 60, ;
		Left = 60, ;
		Width = 72, ;
		Style = 2, ;
		RowSourceType = 1, ;
		RowSource = "EN,FR,DE,LU", ;
		Value = "EN"
		
		PROCEDURE cboLanguage.InteractiveChange()
			ThisForm.lblLanguage.Caption = ;
				ICASE(This.Value = "EN", "Language", This.Value = "FR", "Langue", This.Value = "DE", "Sprache", "Sprooch")
				
			ThisForm.txtDate.LostFocus()

		ENDPROC 

	ADD OBJECT txtDate as TextBox WITH ;
		Top = 60, ;
		Left = 144, ;
		Value = DATE()
		
		PROCEDURE txtDate.LostFocus()
			ThisForm.lblMLCdoW.Caption = TRCDoW(This.Value, ALLTRIM(ThisForm.cboLanguage.Value)) + " - " + ;
					TRCMonth(This.Value, ALLTRIM(ThisForm.cboLanguage.Value))
			
		ENDPROC 
		
		
	PROCEDURE Destroy()
		ThisForm.Release()
		CLEAR EVENTS

	ENDPROC
ENDDEFINE 

**********

FUNCTION TRCDoW()

LPARAMETERS tdDate, tcLanguage

IF PCOUNT() = 2

	LOCAL liLCode as Integer
	LOCAL ARRAY laDays[7, 4]

	laDays[1,1] = "Monday"
	laDays[1,2] = "Lundi"
	laDays[1,3] = "Montag"
	laDays[1,4] = "Meindeg"

	laDays[2,1] = "Tuesday"
	laDays[2,2] = "Mardi"
	laDays[2,3] = "Dienstag"
	laDays[2,4] = "Densdeg"

	laDays[3,1] = "Wednesday"
	laDays[3,2] = "Mercredi"
	laDays[3,3] = "Mittwoch"
	laDays[3,4] = "Mettwoch"

	laDays[4,1] = "Thursday"
	laDays[4,2] = "Jeudi"
	laDays[4,3] = "Donnerstag"
	laDays[4,4] = "Donneschdeg"

	laDays[5,1] = "Friday"
	laDays[5,2] = "Vendredi"
	laDays[5,3] = "Freitag"
	laDays[5,4] = "Freideg"

	laDays[6,1] = "Saturday"
	laDays[6,2] = "Samedi"
	laDays[6,3] = "Samstag"
	laDays[6,4] = "Samsdeg"

	laDays[7,1] = "Sunday"
	laDays[7,2] = "Dimanche"
	laDays[7,3] = "Sonntag"
	laDays[7,4] = "Sonndeg"

	IF TYPE("tdDate") != "D"
		tdDate = DATE()
	ENDIF 

	IF TYPE("tcLanguage") = "C"
		liLCode = ICASE(tcLanguage = "FR", 2, tcLanguage = "DE", 3, tcLanguage = "LU", 4, 1)
	ELSE
		liLCode = 1
	ENDIF 

	RETURN laDays(ASCAN(laDays, CDOW(tdDate), 1, -1, 1, 13), liLCode)

ELSE
	= MESSAGEBOX("Please call developer", 16, "CDoW Translation Routine")
	
	RETURN "Nonsense"

ENDIF

**********

FUNCTION TRCMonth()

LPARAMETERS tdDate, tcLanguage

IF PCOUNT() = 2

	LOCAL liLCode as Integer
	LOCAL ARRAY laMonths[12, 4]

	laMonths[1,1] = "January"
	laMonths[1,2] = "Janvier"
	laMonths[1,3] = "Januar"
	laMonths[1,4] = "Januar"

	laMonths[2,1] = "February"
	laMonths[2,2] = "Février"
	laMonths[2,3] = "Februar"
	laMonths[2,4] = "Februar"

	laMonths[3,1] = "March"
	laMonths[3,2] = "Mars"
	laMonths[3,3] = "März"
	laMonths[3,4] = "März"

	laMonths[4,1] = "April"
	laMonths[4,2] = "Avril"
	laMonths[4,3] = "April"
	laMonths[4,4] = "Abrëll"

	laMonths[5,1] = "May"
	laMonths[5,2] = "Mai"
	laMonths[5,3] = "Mai"
	laMonths[5,4] = "Mee"

	laMonths[6,1] = "June"
	laMonths[6,2] = "Juin"
	laMonths[6,3] = "Juni"
	laMonths[6,4] = "Juni"

	laMonths[7,1] = "July"
	laMonths[7,2] = "Juillet"
	laMonths[7,3] = "Juli"
	laMonths[7,4] = "Juli"

	laMonths[8,1] = "August"
	laMonths[8,2] = "Août"
	laMonths[8,3] = "August"
	laMonths[8,4] = "August"

	laMonths[9,1] = "September"
	laMonths[9,2] = "Septembre"
	laMonths[9,3] = "September"
	laMonths[9,4] = "September"

	laMonths[10,1] = "October"
	laMonths[10,2] = "Octobre"
	laMonths[10,3] = "Oktober"
	laMonths[10,4] = "Oktober"

	laMonths[11,1] = "November"
	laMonths[11,2] = "Novembre"
	laMonths[11,3] = "November"
	laMonths[11,4] = "November"

	laMonths[12,1] = "December"
	laMonths[12,2] = "Décembre"
	laMonths[12,3] = "Dezember"
	laMonths[12,4] = "Dezember"

	IF TYPE("tdDate") != "D"
		tdDate = DATE()
	ENDIF 

	IF TYPE("tcLanguage") = "C"
		liLCode = ICASE(tcLanguage = "FR", 2, tcLanguage = "DE", 3, tcLanguage = "LU", 4, 1)
	ELSE
		liLCode = 1
	ENDIF 

	RETURN laMonths(ASCAN(laMonths, CMonth(tdDate), 1, -1, 1, 13), liLCode)

ELSE
	= MESSAGEBOX("Please call developer", 16, "CMonth Translation Routine")
	
	RETURN "Nonsense"

ENDIF
********* 

MarK

RE: Character day of week (cdow()) or cmonth() in VFP into german -are there settings in the VFP?

Use the german resource dll vfp9rdeu.dll and cdow() returns german names.
This only works in the final EXE, in the IDE cdow() uses vfp9.exe as "runtime", which returns English names and terms.



Chriss

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close