Solved

How to switch language in multi-lingual app that uses bds 2006 translation manager

Posted on 2006-06-16
2
431 Views
Last Modified: 2013-12-03
Delphi 2006

I created a simple app with one button on the form, with a caption 'close'. Then I did Project->Languages->Add and added a french language. Then I used the Translation Editor to set the french equivalent of 'close'. Love it. Things couldnt be easier. Now then, in order for me to see that button in french when I run the app, I need to go to Control Panel->Regional And Language Options and switch from English to French. Thats nice too. But, what if I want that button in french to display irregardless of my current language setting. Is there a way to force it. Or better yet, can I change it at run time?
0
Comment
Question by:krupini
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:krupini
ID: 16923100
I want the language switching functionality to be buit-in into the app that will override the Regional And Language Options settings.
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 400 total points
ID: 16923746
From:
http://info.borland.com/techpubs/delphi/delphi5/dg/intapps.html

Hope this helps,
Russell

---

Dynamic switching of resource DLLs

In addition to locating a resource DLL at application startup, it is possible to switch resource DLLs dynamically at runtime. To add this functionality to your own applications, you need to include the ReInit unit in your uses statement. (ReInit is located in the Richedit sample in the Demos directory.) To switch languages, you should call LoadResourceModule, passing the LCID for the new language, and then call ReinitializeForms.

For example, the following code switches the interface language to French:

const

  FRENCH = (SUBLANG_FRENCH shl 10) or LANG_FRENCH;

if LoadNewResourceModule(FRENCH) <> 0 then

  ReinitializeForms;

The advantage of this technique is that the current instance of the application and all of its forms are used. It is not necessary to update the registry settings and restart the application or reacquire resources required by the application, such as logging in to database servers.

When you switch resource DLLs the properties specified in the new DLL overwrite the properties in the running instances of the forms.

Note: Any changes made to the form properties at runtime will be lost. Once the new DLL is loaded, default values are not reset. Avoid code that assumes that the form objects are reinitialized to the their startup state, apart from differences due to localization.


0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Is there a standard name for this icon in Technical Writing 10 88
control image tags in a string ? 12 169
DBGrid or StringGrid ? 6 136
Can Live bindings change TGrid Cell Colour ? 1 61
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question