473,471 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Loop through controls to change labels/buttons per language

Hi,

We're working on what will become a multi-language application, and I
wanted to see if this idea is feasable.

What we're thinking of doing is creating a table to contain all text
of the application and in multiple languages, for example:
Col1 - ID
Col2 - English
Col3 - French
Col4 - Spanish

When the application launches the user selects a language, and both
English and their chosen language will be loaded into a Dictionary in
memory. Then at the Form Load event for each form that loads, it'll
loop through all labels and buttons on the form, search the dictionary
for the given text, which is English, and replace it with the
alternative language text.

For dropdowns being populated by a look-up table, if these are saved
as a dictionary in of themselves, the look-up dictionary could then be
compared to the language dictionary and translated at Form Load as
well.

This is all in theory, but will this work? Also what caveats are we
looking at? I figure if the language dictionary is loaded when the
application launches there won't be too many DB calls.

Thanks --

Alex
Mar 17 '08 #1
3 1815
On Mar 17, 10:32*pm, Alex <sama...@gmail.comwrote:
Hi,

We're working on what will become a multi-language application, and I
wanted to see if this idea is feasable.

What we're thinking of doing is creating a table to contain all text
of the application and in multiple languages, for example:
Col1 - ID
Col2 - English
Col3 - French
Col4 - Spanish

When the application launches the user selects a language, and both
English and their chosen language will be loaded into a Dictionary in
memory. *Then at the Form Load event for each form that loads, it'll
loop through all labels and buttons on the form, search the dictionary
for the given text, which is English, and replace it with the
alternative language text.

For dropdowns being populated by a look-up table, if these are saved
as a dictionary in of themselves, the look-up dictionary could then be
compared to the language dictionary and translated at Form Load as
well.

This is all in theory, but will this work? *Also what caveats are we
looking at? *I figure if the language dictionary is loaded when the
application launches there won't be too many DB calls.

Thanks --

Alex
Should work. But you may also consider XML which is quite popular. INI
files were being used also for multi-language applications IMHO.
Mar 17 '08 #2
You might want to look up "Localization" or "Globalization" in the help file
and check other places for those topics.
--
Terry
"Alex" wrote:
Hi,

We're working on what will become a multi-language application, and I
wanted to see if this idea is feasable.

What we're thinking of doing is creating a table to contain all text
of the application and in multiple languages, for example:
Col1 - ID
Col2 - English
Col3 - French
Col4 - Spanish

When the application launches the user selects a language, and both
English and their chosen language will be loaded into a Dictionary in
memory. Then at the Form Load event for each form that loads, it'll
loop through all labels and buttons on the form, search the dictionary
for the given text, which is English, and replace it with the
alternative language text.

For dropdowns being populated by a look-up table, if these are saved
as a dictionary in of themselves, the look-up dictionary could then be
compared to the language dictionary and translated at Form Load as
well.

This is all in theory, but will this work? Also what caveats are we
looking at? I figure if the language dictionary is loaded when the
application launches there won't be too many DB calls.

Thanks --

Alex
Mar 17 '08 #3
Terry,
You might want to look up "Localization" or "Globalization" in the help
file
and check other places for those topics.
--
You have ever tried that for this purpose? In my idea works the solution
from the OP much easier.
(And if he uses datasets written and read as XML then is is probably even
more simple)

Localization and Globalization don't give solutions for languages, only for
culture settings as decimals and the way dates are written.

Although the big problem stays how to get the correct equivalents for a
languages, that is not just looking in a dictionary, because a translation
can have a big other meaning then what you think as you are not familiar
with that language.

Beside that is it a hell of a job.

Cor

Mar 18 '08 #4

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

Similar topics

3
by: Kevin | last post by:
Hi i'm having a problem passing an arrays of controls on a form to a function or sub. I can use this code for any datatype but when i change 'long' to 'label' in the public sub and i call the sub...
7
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET)...
3
by: Terrance | last post by:
I've built a user control inherited button and I need it to change the enabled property of all the controls on the form except for the labels and buttons. I'd like to use this control on other...
5
by: Wolfgang | last post by:
Dear all, I've a lot of buttons named button1..button100 and want to change some of there propertys. Maintaining the overview I'm looking for a possibility for something like: ...
2
by: tony collier | last post by:
hi i have various labels on my page with ID's label_1, label_2 , label_3 etc. How can i write a loop that sequentially changes their text values to values i have in an array eg;. for...
3
by: jcrouse | last post by:
I am trying trying to loop through some label controls and setting some properties for the labels I'm looping through. Currently I am addressing the labels one at a time with IF...Then logic, like...
1
by: Saso Zagoranski | last post by:
Hi, I've developed a Winforms application for a few people. It's a very basic Form with a few textboxes, comboboxes, buttons, labels and one PictureView. With 1024x768 screen resolution the...
1
by: SerialChick | last post by:
Hi, So i created a form called board. and on this form placed a whole heap of labels, buttons and a menu. Now from the menu there is a New Game option. When this is clicked a new form is opened...
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,...
1
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.