Loading...
 
Multi-Language Add-In for Visual Studio

Multi-Language Add-In for Visual Studio


Best practice for multiple strings on a line?

Just wondering what is the best practice where one line may contain multiple strings, but not all strings should be subject to translation.

The line below will show as two strings in the tool's source code grid:

AddText("DES_IIT", "Measures the overlap of imports and exports at a given aggregation level.")

In this instance the first string is a key and should not be translated. after hidding the first string and selecting the second string the line will show as:

AddText("DES_IIT", ml_string(12,"Measures the overlap of imports and exports at a given aggregation level.")) 'MLHIDE

Which is fine, I guess the hide tag means hide all strings on this line that don't have a translation, I am just worried that if someone later amended the source to:

AddText("DES_IIT", "TRANSLATE ME " & ml_string(12, "Measures the overlap of imports and exports at a given aggregation level.")) 'MLHIDE

The new string would not be picked up on a rescan?

Germany

This is clearly a weakness in the system. I would be better if the Add-In could mark an individual string as hidden, rather than the whole line.

On the other hand, the system with MLHIDE is very simple, which is in itself a strength. I have not come up with a way of marking individual strings as hidden which is anything like this simple.

My personal recommendation would be to hide the line. In particular, I would recommend going through every single line in the grid and either selecting the text for translation or hiding it. Then - in normal cases - it is easy to detect new strings in the project.

However, as you rightly point out, you could easily miss a string which is added to a line which is already hidden. (There don't initially have to be multiple strings on the line.) Having said that, I think it is a fairly low risk.

If the programmer thinks about it, he or she could actively remove the MLHIDE comment in such a case.

The Add-In would of course detect the new string and it would show it if you toggle the sun/moon symbol on the toolbar to show the moon.

Phil

Thanks Phil,

I think the idea of getting a programmer to remove the MLHIDE comment if they alter a string on a hidden line is a great and simple idea.