Application in Multilanguage (internationationalization)

Hi, all,
I need your help here.
I need to convert a English version of VB apps into other international language.
What is the best way to do it?
I'm attempting to use VB resource file to keep the translation but i wonder that is the correct way to do it? But then I have to segregate out the string(s) at User Interface, including the menu. What is the fastest way of doing it without compensating the future maintainability? Any available tools that can help me?

Please help.

Regards,

Becky
BeckyDDAsked:
Who is Participating?
 
VincentLawlorConnect With a Mentor Commented:
Hi,
That's fine with me all the points would be nice though :-)
Vin.
0
 
VincentLawlorCommented:
Yes resource files are the best way of doing this.

You could also consider reading your resources on startup form a file. This means you could swap the file in and out depending on the language without having to recompile your code.

This file would be the same as a .Res file.

Vin.
0
 
VincentLawlorCommented:
Sorry I meant to say similar to a res file

It would contain a list of name value pairs.

eg.

100=&File
101=&Close

etc.

You open this file on startup one line at a time and assign the names to your controls etc using their tag property where tag = value in the file.

If you don't want to do it this way then RES files are a good approach.

You can also define multiple languages in your RES file.
So if the default locale is changed the appropriate language is used.

Vin.
 
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
BeckyDDAuthor Commented:
Hi, Vincent,
Thanks for the response, but I have a problem here:
I'm using Res file, and I need to assign every single string that display to users with the LoadResString(index).
It means, I will have to add-in a many many lines of codes in my current apps including menu, tooltips, label, button, message box, etc...
And do it line by line cause each line will reference to a different index in my res file.

Does it sound correct?

Secondly, the different version only works when the users choose the differet locale setting....
what if I want to make it such a way that user just need to choose the language from my apps and the display will immediately change to the new language...

Does it make sense??

Sorry that, I'm too new with all this internationalization stuffs.. but would hope to get some advices from anybody ...

Thanks & regards,

Becky


0
 
BeckyDDAuthor Commented:
Hi, Vincent,
Thanks for the response, but I have a problem here:
I'm using Res file, and I need to assign every single string that display to users with the LoadResString(index).
It means, I will have to add-in a many many lines of codes in my current apps including menu, tooltips, label, button, message box, etc...
And do it line by line cause each line will reference to a different index in my res file.

Does it sound correct?

Secondly, the different version only works when the users choose the differet locale setting....
what if I want to make it such a way that user just need to choose the language from my apps and the display will immediately change to the new language...

Does it make sense??

Sorry that, I'm too new with all this internationalization stuffs.. but would hope to get some advices from anybody ...

Thanks & regards,

Becky


0
 
VincentLawlorCommented:
>>I'm using Res file, and I need to assign every single string that display to users with the LoadResString(index).
It means, I will have to add-in a many many lines of codes in my current apps including menu, tooltips,
label, button, message box, etc...
And do it line by line cause each line will reference to a different index in my res file.

Yes that's the way is should be done.

>>Secondly, the different version only works when the users choose the differet locale setting....
what if I want to make it such a way that user just need to choose the language from my apps and the
display will immediately change to the new language...

Ok there is a way of doing this without changing the default locale on the machine.

Create two new ActiveX DLL projects (number of projects depends on the number of languages required but for this example two will suffice).

Name the projects as follows
LocalEnglish
LocalIrish

Rename Class1 in both cases Resource

Using the Resource Add in in Visual basic add a resource to each project name the .Res files LocalEnglish and LocalIrish.

Just for example add "How Are You" to the LocalEnglish resource and "Conas ata tu" to the LocalIrish resource.

Add the following code to each class module.

Public Function GetResourceString(ResourceIndex As Long) As String
         GetResourceString = LoadResData(ResourceIndex, 6)
End Function

Make both ActiveX DLLs. Save the projects and close them.

You now have a means of switching between resources in your code.

Just do the following and test it.


Dim objLocalised as Object
Dim strLanguage as String
strLanguage = "English"


Select Case strLanguage
   Case "English"
        objLocalised = CreateObject("LocalEnglish.Resource")
   Case "Irish"
        objLocalised = CreateObject("LocalIrish.Resource")
   Case Else
End Select

Dim strTemp as String  
strTemp = objLocalised.GetResourceString(101)

If you change the strLanguage to "Irish" you will get the Irish version of How are you.

That should be it.

Vin.


 

Vin.



 
0
 
VincentLawlorCommented:
Just checking in how did you get on with this ?

Vin.
0
 
VincentLawlorCommented:
Hmmm...

Vin.
0
 
BeckyDDAuthor Commented:
Hi, Vincent,
Thanks for the reply.
The problem is that I will have more than one .exe file in my app.
Is there any way I can make it a way that users can select the language from the app... and change it accordingly?

regards,
BK
0
 
VincentLawlorCommented:
Ok to select the language:

Start with the default language say English.

Add a dialog to the application for language selection. This can be as simple as a combobox with a list of the supported languages.

In a module add a public String to indicate the language selected

Public gLanguageSelected as String

In your dialog box select the language.

gLanguageSelected = Selection


The rest of the code is the same as I described earlier.

Dim objLocalised as Object
Dim strLanguage as String
strLanguage = gLanguageSelected


Select Case strLanguage
  Case "English"
       objLocalised = CreateObject("LocalEnglish.Resource")
  Case "Irish"
       objLocalised = CreateObject("LocalIrish.Resource")
  Case Else
End Select

Dim strTemp as String  
strTemp = objLocalised.GetResourceString(101)

Vin.

Alternatively you can use the registry to pick the language.

Vin.



 

 
0
 
VincentLawlorCommented:
Progress ??

Vin.
0
 
modderCommented:
BeckyDD,

I've checked that you're still active on the site. You logged in yesterday. Please provide the feedback our expert is asking for. If they answered the question to your satisfaction, award the points. If not, let them know so they can continue working on a solution for you

Experts-Exchange is not a news group, in which you can post a question, get the answer, and walk away, or ignore any posts that do not serve to solve your problem.

You can read more about how the site works in our member agreement: http://experts-exchange.com/jsp/infoMemberAgreement.jsp

Although the agreement tells you something about how the site works, it doesn't tell you much about the netiquette that has evolved on our site. In Experts-Exchange it is expected that you always provide feedback to those who participate in the questions that you post. And I'll explain why this is the case.

When a question is resolved, it becomes a Previously Answered Question, and will be stored in the database. Users who have similar problems can buy your question for 1/10 of the original point value in order to find a solution to *their* problem.

A a result it is important that you provide feedback to our experts

If an expert provides a suggestion that solves your problem, award them by grading the answer so that the question does indeed become such a "PAQ". That way future visitors of this question get the most out of it.

If you did *not* get a satisfactory response to one of your questions, you have to tell participants that this is the case, so that they know that you have read and understood their suggestions, even though it didn't help you. After that, by all means, you can contact me or post a question in the Community Support topic area, and ask us to delete the question and refund your points.

I would also like you to consider this: Our experts are willing to spend some of their precious time to help you solve your problem. A lot of our experts are professionals, to whom time is money. And they're willingly giving up some of their time to help you.

And the only thing we're asking in return is a bit of feedback and an effort on your behalf to participate according to our member agreement and our peculiar brand of netiquette. I think that is a pretty good deal, don't you?

modder
Community Support Admin
0
 
BeckyDDAuthor Commented:
Thanks, Modder,

Thanks for your reminder. Sorry for my neglect. I was temporary off from the translation project. Vincent, thanks for the solution being provided.

In fact, VincentLawlor has give me a good suggestion, but then I was not very keen of the method being suggest at that time. There may be other method.

So, what is the best way I should do, Mr. Modder?

Regards,

Becky
0
 
modderCommented:
Perhaps we could agree to award half the points or something? Vincent, how does that sound?
0
 
modderCommented:
Anyway - thanks for responding. Between yourself and Vincent I hope you can come to an arrangement, and when you do, just let me know, and I will be of assistance with things that you can't do yourself.

Regards

modder
0
 
BeckyDDAuthor Commented:
Hi,
Thanks, Vincent. Emmh.. I agree to give you 80 points instead of 100. OK?
0
 
modderCommented:
Sounds good to me. Sorted!
0
 
VincentLawlorCommented:
That's cool thanks

Good luck.

Vin.
0
 
BeckyDDAuthor Commented:
Thanks, Vincent, Thanks Modder.
: )
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.