473,396 Members | 1,996 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,396 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 2464
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.