Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Internationalization of Resource Files

Posted on 1997-08-20
2
Medium Priority
?
189 Views
Last Modified: 2006-11-17
I am using VB 5 and V C++ 5.

I know of two ways to translate the string table from an English resource file into Spanish.

The first method involves using the same resource file to store all of the strings.  The various languages stored in the file are stored using an offset.  For example, all English strings could be stored from IDs 0 to 9999 while their corresponding Spanish strings could be stored from 10000 to 1999.  Each language would then get its bank of 10000 strings.  In order to access these strings from code, you simply do a LoadResString(ID + GlobalLanguageDelta).

The second method involves keeping the entire resource file in English.  The Spanish version of this resource file would then be a completely different file.  If you want a Spanish version of your software, then simply package the appropriate resource file with your product.

If you are still reading, I'm impressed.  Anyway, here is my question.  I am using V C++ to create/edit my resource files.  I stumbled over the option that allows you to Insert-Resource Copy...  If you highlight your string table and then "Copy" that resource, you get a second string table.  The interesting thing is that it asks you for a locale.  For example, I could copy my entire string table to an identical string table except the second table would be associated with the Spanish(Modern) locale.  I could then have this file translated and save a resource file with both string tables!  I haven't seen this before.

Further inspection reveals that the first string table you create is simply associated with the English(US) locale.  I have created a sample application that simply loads a string into a text box. I was hoping that the string loaded would depend on my system's settings.  I created a resource file with two strings tables (one for English and one for Spanish).  When I run my example VB 5 application, however, all I ever see is the English version of the text data.

Does anyone know how to get this method of localization to work?  If I can create multiple string tables within the same resource file how do I specify which resource table my application extracts it's string data from?

Any help here is greatly appreciated.

Robert
0
Comment
Question by:lankford
[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
 
LVL 3

Accepted Solution

by:
dansari earned 300 total points
ID: 1431547
Robert:

There is almost definitely no way to get this method to work - LoadResString takes the resource ID, but you cannot specify which 'language' is selected.  I know this because Visual Studio comes with a good book 'Visual Studio Getting Results', and in it  is described a method of localization similar to the first, with a 'language base/offset' number.  The controls on the form (labels, for example) have the Tag property set to the offset in the resource ID, and when the user switches the language, the labels and whatever else all need to get set again (in code) from the resource file.

I'm not sure how the 'copied' string table is used from VC++, but according to the on-line help for LoadResString, and the fact that it's not mentioned in the 'Getting Results' book when they talk about localization (for VB), I'm pretty sure it's not possible.
0
 

Author Comment

by:lankford
ID: 1431548
Does anyone know how to reference these multiple string tables  from a Visual C++ 5 application?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

730 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