473,289 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Dual language interface

OM
Hi,

I have a simple Access application, for recording fuel use, and generating a
few reports. It is necessary that the forms (such as the menu, and data
entry forms) be in Thai as well as English.

There are 4 ways that I have imagined how to do this, but I'm not sure which
are practical, or easiest etc.

1. I was considering just adding the Tai to the existing labels and
controls, so each had both languages, but Thai is a difficult language
(actually needs up to 4 lines per letter), and some of the entries got
pretty unwieldy.

2. I then considered having all the labels etc duplicated, one set in Thai,
one set in English, and a button on the Main Menu, that allowed the other
language to be used. My thoughts on this were that I could have 2 labels,
one on top of the other. Only one would be enabled at a time, and clicking
on that one would enable the second, make it visible, disable the clicked
one, and make it invisible. The whole form would be somewhat the same, with
duplicated controls, one set in each language, that are enabled and made
visible, depending on which button is pressed on the Main Menu (actually,
could have a button on each form, but I would need to make the change
permanent until the language change button is pressed a second time,
otherwise the user would have to click on every form opened).

3. The next thing I considered was having 2 complete sets of forms, one set
in English, one in Thai. When the user clicked (say) the Thai button on the
main menu, the program branched (not sure if thats the right term) to the
Thai set. The user would have to go back to the main menu to change to the
other language.

4. Last I have all the text for controls, labels etc, in a table. One field
is the English text, the other is the Thai. A button on every form would
switch between the two languages, by changing the labels and controls
source, from field 1 to field 2, or vice versa.(This would have the
advantage of being able to use more languages - just enter the
menu/label/control equivalents in each languuage).

Question.
Which way is "best" ? Note that I am something of a beginner in coding, but
can struggle by. If anyone knows of any code examples available, it would be
a help.

Thanks,

Robert Lepper
Nov 12 '05 #1
2 2459
Hello,

I would prefer the 4. Method.
As you mentioned it will give you more fexibility (Adding new languages
correct spelling errors etc) but there will be a lot of work.

One suggestion of implementing this feature

store the appropriate language value in a global variable
For each label place a unique string (id) in the "tag" property
create a table named labels
uniqueid text(64)
language long integer
labeltext text(255) 'to enter the text

create a query "GetCaption" with sql
"Parameters enterid text, enterlanguage long; Select labeltext from labels
where uniqueid=enterid and language=enterlanguage"

place a public sub in a moudule.
Public Sub GetLabel(myForm as object)

'Data objectdefinitions -depending on ado,dao or rdo
'assuming dao

dim dbdatabase as database
dim rsdata as recordset
dim qrylanguage as querydef

set dbdatabase=currentdb()
set qrylanguage=dbdatabase.querydefs("GetCaption")

'Declaring other objects and variables
ctControl as control

for each ctcontrol in myform.controls
if control is typeof label then
qrylanguage("enterid")=control.tag
qrylanguage("enterlanguage")=choosenlanguage 'the global variable
set rsdata=qrylanguage.openrecordset
if rsdata.eof then
'No entry for language/tag combination here leave caption unaltered
else
control.caption=rsdata("labeltext")
endif
endif
next

end sub

In each forms/reports Load-event call this sub with
call getlabel(me)

Never tried this for myself, but with some fine tuning it should work

HTH
Karpi
<fluctuat nec mergitur>

Am Sat, 03 Apr 2004 10:19:17 +0700 schrieb OM:
Hi,

4. Last I have all the text for controls, labels etc, in a table. One field
is the English text, the other is the Thai. A button on every form would
switch between the two languages, by changing the labels and controls
source, from field 1 to field 2, or vice versa.(This would have the
advantage of being able to use more languages - just enter the
menu/label/control equivalents in each languuage).

Question.
Which way is "best" ? Note that I am something of a beginner in coding, but
can struggle by. If anyone knows of any code examples available, it would be
a help.

Thanks,

Robert Lepper


Nov 12 '05 #2
"Hans-Joerg Karpenstein" <hj***********@web.de> wrote in message
news:pa****************************@web.de...
Hello,

I would prefer the 4. Method.
As you mentioned it will give you more fexibility (Adding new languages
correct spelling errors etc) but there will be a lot of work.

One suggestion of implementing this feature

store the appropriate language value in a global variable
For each label place a unique string (id) in the "tag" property
create a table named labels
uniqueid text(64)
language long integer
labeltext text(255) 'to enter the text

create a query "GetCaption" with sql
"Parameters enterid text, enterlanguage long; Select labeltext from labels
where uniqueid=enterid and language=enterlanguage"

place a public sub in a moudule.
Public Sub GetLabel(myForm as object)

'Data objectdefinitions -depending on ado,dao or rdo
'assuming dao

dim dbdatabase as database
dim rsdata as recordset
dim qrylanguage as querydef

set dbdatabase=currentdb()
set qrylanguage=dbdatabase.querydefs("GetCaption")

'Declaring other objects and variables
ctControl as control

for each ctcontrol in myform.controls
if control is typeof label then
qrylanguage("enterid")=control.tag
qrylanguage("enterlanguage")=choosenlanguage 'the global variable
set rsdata=qrylanguage.openrecordset
if rsdata.eof then
'No entry for language/tag combination here leave caption unaltered
else
control.caption=rsdata("labeltext")
endif
endif
next

end sub

In each forms/reports Load-event call this sub with
call getlabel(me)

For reasons of performance, opening a separate recordset for each label is
probably not a good idea. I suggest using another column in your
translations table to hold the form name. When you open the form, create a
fast-forward recordset of language-specific translation data for that form
and run through the recordset once. This example uses ADO and a sql server
translations table but it should give you the general idea: Note that the
translations table also has a column "properties" so you can translate
different control properties such as ControlTipText, StatusBarText, Caption
etc.
Sub SetLanguage(frm As Form, lang As String)

Dim cmd As ADODB.Command
Dim rst As ADODB.Recordset
Dim sql As String

sql = "SELECT controlname, propname, " & lang & " AS language FROM
dbo.translations WHERE objname = '" & frm.Name & "'"
Set rst = New ADODB.Recordset
rst.Open sql, CurrentProject.Connection, adOpenForwardOnly,
adLockReadOnly, adCmdText
Do Not While rst.EOF
If rst("language") <> "" Then
If rst("controlname") = frm.Name Then
' form property
frm.Properties(rst("propname")).Value = rst("language")
Else

frm.Controls(rst("controlname")).Properties(rst("p ropname")).Value =
rst("language")
End If
End If
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
Set frm = Nothing

End Sub







Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tomer Ben-David | last post by:
Hi I have a big j2ee appliction that was so forth run on a single cpu machine. I have tested it on a dual cpu machine, its running much slower (about X3 times slower). I know that...
42
by: Fred Ma | last post by:
Hello, This is not a troll posting, and I've refrained from asking because I've seen similar threads get all nitter-nattery. But I really want to make a decision on how best to invest my time....
5
by: John Dalberg | last post by:
I am planning to build a server to be used as a SQL Server and web server. Right now I can only use a single box for both. I have read some threads were dual processors are having problems with...
3
by: Xiaopeng Qu | last post by:
Hi, I installed DB2 8.1 Express with multiple language: English and Chinese, but the interface like: Control Center, CLP, etc alway display Chinese, is there a way to change the display language...
2
by: OM | last post by:
Hi, I have a simple Access application, for recording fuel use, and generating a few reports. It is necessary that the forms (such as the menu, and data entry forms) be in Thai as well as...
2
by: Todd Brooks | last post by:
I have a coclass that implements a dual interface. The thing that's a little unusual is that the coclass doesn't inherit directly from the interface, rather it inherits from an implementation class...
3
by: Michel Meex | last post by:
Hello, I have an application, that has been running on a single processor server for more then a year without any problems. Now I'm migrating to a dual processor server, and I'm experiencing...
1
by: Michel Meex | last post by:
Hello, I have an application, that has been running on a single processor server for more then a year without any problems. Now I'm migrating to a dual processor server, and I'm experiencing...
0
by: George3 | last post by:
Hello everyone, Could anyone show me a sample or where to find dual interface implementation for IDispatch please? I have seached for MSDN and Google for half an hour and seems all I could...
1
by: =?Utf-8?B?U29sb1NFTw==?= | last post by:
Windows Vista™ Ultimate 32BIT Version 6.0.6001 Service Pack 1 Build 6001 System Manufacturer HP Pavilion 061 System Model EG194AA-ABA A1250N System Type X86-based PC Processor AMD Athlon 64 X2...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.