Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a language 1

Status
Not open for further replies.

jay2502

Technical User
Apr 20, 2007
25
0
0
A2
I have Created a database in english I now have to have it in english and portugese (only front end) how would be the best way to do this with the user choosing his preferance.
I thought of copying all the forms translate it and have an option some where to change it between the languages.
Is this the only option or can anyone come up with some thing better.
 
My best solution would be to have the language preference stored in a field in some table, accessible by an option button on a form. Then create an Form_Open or Report_Open event handler for each form and/or report that needs to be translated.

In the open event, set the captions and/or ControlTip for each control that needs to be variable. For example,
Code:
Select Case strLanguage
    Case "English"
        Me.Caption = "Hello."
        lblX.Caption = "Where can I get a taxi?"
        lblY.Caption = "Will you help me with my bags?"
        lblZ.Caption = "Please stop at the next corner."
    Case "Portuguese"
        Me.Caption = "Alo."
        lblX.Caption = "Onde posso arranjar um taxi?"
        lblY.Caption = "Pode me ajudar com as malas?"
        lblZ.Caption = "Por favor,pare na proxima esquina."
End Select
(Please excuse the cheesy example; I'm sure you have much more informative captions in mind.)

Making your changes in code will eliminate doubling the file size for having copies of each form and report. It will also make editing much easier since you only have to edit one object, rather than duplicating your changes for each language.

[red][banghead]— Artificial intelligence is no match for natural stupidity.[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top