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

Multi-Language Add-In for Visual Studio


How to review all strings in DB and merge string IDs?

Today I can browse files in the tool's UI. Either by selecting a file and review the strings inside this file or going to Tools and select "Remove unused strings" (that will make me able to see string id's that are no longer in use - deleting them makes sense in some scenarios).

But.. Using the tool, I found that I sometimes have 2 string IDs with the same content - sometimes this makes sense (the same word in English can be translated into different words in other languages depending on context), but other times this is just by mistake and I need to merge the two.

So is the only way to merge by:

  1. exporting to excel
  2. sorting excel content by e.g. English
  3. manually searching thousands of strings to find duplicates
  4. navigate to a string IDs of the duplicates (that I want to remove)
  5. change the string ID to the correct one
  6. search the same string ID again (might be several using same ID - and all needs to be merged) and if string ID is still in project, go to step 5
  7. Once all duplicated string ID's is unused, go to "Remove unused strings"
  8. Manually find String ID prevously removed
  9. select String ID
  10. Click "Delete" button


Is this really the best approach for merging?

Germany

It sounds like you need a command in the tools menu, something like "Merge duplicate translations". I can see two levels.

  1. The first level would be totally automatic. If two or more string IDs have identical translations (or missing translations) then they can be merged directly.
  2. The second level would be interactive. If two or more strings IDs have the same original text, but different translations, they would be listed in a dialog. You select which string IDs you want to merge.

This sounds like a sensible feature.

Phil


You got it - spot on! This feature would help a lot.
Germany

I have just uploaded a new version (5.0x.0074) with a new dialog to merge string IDs. I haven't tested it enough yet, so you should consider it as a beta version.

I don't think the user interface is well designed, but I wanted to get something working quickly. I can improve it later.

The new command is in the tools menu:

Image

This command searches for multiple StringIDs which have the same text in the original language and shows them in a dialog.

Image

The first column (Scope) shows the project name, or "Solution" if solution scope is used. The second column shows the text in the original language, and a list of StringIDs which share this translation. The remaining columns show the translations associated with the string ID.

This is where the UI gets a bit weird. The idea is to rearrange the 'tree' so that StringIDs which should be removed are below the StringID which will replace them. By below I mean below in the grid, and also in the tree structure.

You can move the StringIDs in the grid with the blue arrow buttons.

In the following screen shot the StringIDs 30, 32, 32 and 29 are below 33. If you close the dialog with the Merge button, they should be replaced with StringID 33.

Image

The arrow buttons do some non obvious things. In some cases, the left arrow actually moves other nodes to the right (and vice versa).

It does not work with drag and drop, although this might be an improvement.

This dialog works only with StringIDs. It doesn't show where the individual StringIDs are used. I could probably make a similar dialog showing exactly where each StringID is used. Since each ID can be used in multiple places, this would allow more fine grained changes. I don't know if this would be better or not.

Phil


Wow - this looks great! :-)

A quick thought might help you twist the UI to something more intuitive.. When you merge strings, you are working with a collection of strings with the same text. Some might have the same text in the original language, but has a different meaning and therefore different text in some other languages. So essentially what you want to do, is selecting a "master id" that will survive the merge, and then select the strings that needs to go into this "master id" (and thereby, the rest is ignored and will not be merged).

To overcome this you could just add 2 selections similar to when strings is selected in the tool today:

  • First selection could be "master" - only one can be master within the collection of texts of the same name.
  • Second selection could be either "merge" or "ignore" (depending if you make a positive list or negative list).


Above can be done with technology similar to what you use today - that might help you make an easier solution than drag and drop - and troubleshooting the bugs with errors.

Well just an idea :-)


I tried to merge my suggestions with your UI - please see attached. I think something in that direction might be more intuitive.

The limitation of my suggestion is of course that you are only able to merge the same strings into 1 "master target" per "merge round". Lets say you have 4 strings, 2 pairs of different meanings (but same original string) - so you want to end up with 2 strings. With my suggestion you would need 2 "merge rounds" to merge the two pairs.. But well.. I think a "split up" (because a translator request it) is more common than a developer deciding what strings to merge into 2 different targets. At least I as a developer doesn't have the knowledge required to make that decision.

The 2 most important columns to the right for me would be "Original Text" and "Comment" (and maybe my "own language": Danish). All other languages is irrelevant for me in the process.



Any update on this topic? :-)
Germany

I have just uploaded version 5.0x.0078.

I have modified the user interface of this dialog more or less as you suggested.

Phil

Very nice :-) Thank you very much! Much appreciated! :-)