Multi-Language Add-In for VB6

Multi-Language Add-In for VB6

Const string not detected


We have a vb6 app which we've written in french.
Now we plan to make it available in english.
So your tool seems great. I'm testing it with the demo.

Unfortunetely, there something that seems strange:
Const declaration seems not taken in account.
They are not referenceed after the project scan.

Now I think about it, the translation function can not be applied to const since it is a const...
Is there a workarround for that?

For instance, I have a module with hundreds of string messages stored in consts.
what can I do?

Thanks in advance,


Hi Marc,

as you have realised, the translation function will not work for const strings.

The only way to handle them is to change them into normal variables, and initialise them in code, for example in the Form_Initialize or UserControl_Initialize function.

The Add-In can then translate them at the point where they are intialised.

I could probably make add a new command to the tools menu, to search for const strings and make this change automatically. This would probably be a good feature.

On the other hand, I would be happier if you could make the change yourself.

Do you have hundreds of consts together in one file, or are they spread all over your project?

If they are all together it should be easy enough to convert them (although I would probably use a more powerful editor than VB6).

Best regards


By the way, there is a similar problem with optional functional parameters. You cannot replace the value of an optional parameter with a function call either!


Thanks for your quick answer.
I think I can handle the solution you gave. My strings are almost all in one Module.

Note that my const strings are in a Module, not a Form or class Module, and therefore there is no _Initilize() function related.

So I'm gonna create one InitialiseMyStrings function in that module and put all strings.

And I will have to call it from somewhere (first loaded form I think).