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

Multi-Language Add-In for Visual Studio


Feature Request: Suggest to reuse String ID, when only case difference

Hi Phil,

Long time no see. Hope you are doing good!

Through our time using the tool we keep having a re-occuring issue.

We have a lot of strings in our database and we want to reuse those strings as much as possible! Unfortunately, we realized a little too late, that having a "upper/lower case convention" from the beginning would have been a good idea.

Imagine having "Multi Language" as a string previously translated.
We now scan this string: "Multi language".

Today the tool will simply add a new string (wich is the most accurate automated behavior) - however, I would suggest for the tool in the future to prompt the user in above scenario. Prompt could contain suggestions like:

We have suggestions for "Multi language":

  1. Use ID:1234, and change to "Multi Language" (original string) everywhere
  2. Use ID:1234, and change to "Multi language" (new string) everywhere
  3. Create new ID for "Multi language"


I know it might be more complicated, since you could have multiple suggestions like:
"Multi Language"
"Multi language"
"multi language"

But if you where able to handle the simple use case of 2 versions of the same string when case is ignored, then it would address 99.9% of this kind of issue.

Yours Faithfully,
Nick Niebling

Germany

Hi Nick

I'll think about this.

Maybe I could open a dialog from the tools menu, something like "Check upper and lower case", to search for these kinds of strings and show them in a list. I'm not quite sure how it would work, but you should be able to select which ones you want to replace when you click on OK.

Alternatively I could add an Icon to the grid to indicate that there are identical texts which differ only in the case. If you click on the Icon it would show you where the texts are. There could be a command in the context menu "Goto next case issue".

I'm struggling to find a good term, so maybe we will have to invent one. How about "Case inconsistency" or "Inconsistent capitalization" or "Caps mismatch"?

Anyway, its a good idea.

I'm working (unfortunately quite slowly) on support for Windows Store Apps, which I would like to finish first, but then I will try to implement something.

Phil


Sounds good!

I like your idea with the Icon - the only negative about that, is the extra space it will take up. But that's a minor detail.

Any of your term suggestions could be fine.

I like "Case inconsistency" best.

"Inconsistent capitalization" refers to the first letter in each word rather than all letters of the word (the scenario of "POV" vs "Pov" shouldn't be covered by this term)

"Caps mismatch" is slightly less explicit IMO, since "Caps" is refering to uppercase letters (where "Case" is refering to either upper or lowercase). However, this could work just fine.

Other combinations of above would be fine as well: "Caps inconsistency", "Case mismatch", "Inconsistent case" or "Inconsistent caps").

Thanks for everything.

Germany

Hello Nick

It has taken me a long time to do anything, but I have finally implemented a feature in version 6.01.

At your suggestion I had already implemented a feature to merge duplicate string IDs for the same text. This feature is more or less the same, except with a case insensitive comparison.

Multi-Language now checks for duplicate IDs using a case-sensitive and a case-insensitive comparison and shows an Icon in the 'flags' column. I actually use two different icons, but you might not notice the difference.

Image indicates that there are two string IDs for the identical text.
Image indicates that there are two string IDs for texts which differ only in the case.

The following screen shot shows icons, but is hard to see the difference.

Image

If you click on the icon, it opens the "Merge duplicate translations" dialog. This is basically the same as when you select "Merge duplicate translations" from the tools menu, but it shows the string ID from the main grid with a yellow background and scrolls to make it visible.

Image

I have added a second toolbar with some options to this dialog. One option is case-sensitive (not selected) or case-sensitive (selected).

If I deselected this option in the screen shot above, then the text "Online translation" would be removed from the grid, because the two strings are not identical in a case sensitive comparison.

Apart from that, using the dialog is the same as before:

  • In the left hand column you can select a 'target' string ID
  • After selecting a target, you can select other string IDs (in the group) which will be replaced with the target
  • The merge operation happens when you click on the Merge button, which also closes the dialog.


I have already found this to be a useful feature, so thanks for the suggestion.

By the way, version 6 is implemented as a Visual Studio Package, because Add-Ins as such are no longer supported in Visual Studio 2015. If you are upgrading from version 5, I recommend uninstalling the old version first.

Phil


Hi Phil,

Thanks for looking into this. Better late than never ;) I did upgrade to package installer - actually without uninstalling add-in - it didn't really impact my work in any way (I guess that's a good thing :-) )

Also a big thanks for implementing a new feature like this! I truly believe this feature makes sense for the general user as well! I have a few observations below that you might be able to use for further improvements.

Re-scan courses a lot of duplicated strings
A general frustration I found using the merge tool is... Sometimes when I re-scan our project (if I haven't done it for some time), the tool will add a lot of strings as new strings, even though I previously merged them. It could be strings that are translated or not.

E.g.: On re-scan, the tool would sometimes add "true" in multiple times (with separate string IDs), as if it never saw this string before (even though I have merged and/or marked it to be ignored months ago).

This behavior is forcing the string ID to increase very fast (that's only a semantic issue), but even worse, it's also making this merge window really hard to use: A lot of the stuff I previously merged, sometimes gets added into X new IDs, forcing me to merge again. This could both be strings that's marked for translation or not. I think it's often/mostly "untranslated strings", but have seen it for strings marked for translation.

How this impacts me
For me, this is often strings containing numbers - e.g. 0,1,2,3,4 as "ID" of a drop down item (since this is for some reason something someone needs to translate some times). Also strings as true, false, pdf, xls, etc. is something I see a lot with this issue. It might sound minor, but I guess I spend like 1 hour each time I do a re-scan, to simply merge these again (remember, it's also translated strings doing this - and I need to make sure we use the previous translation if we have it - so I need to go through everything).

I guess I have 100+ strings, with an average of 10 duplicates to be merged into 1 string after each re-scan.

Making it a tad worse, this is also taking so much time because the default behavior is "not to merge" when I select a target. So I click a target and then (in 999/1000 cases) I will manually select 10 strings to merge into the target - clicking e.g. 10 times with the mouse. Takes time to hit all the small check boxes.

Suggestions
Just a few minor suggestions that would help me work-around the actual bug (that I cannot identify the the root for or suggest actual solutions for) could be:
1) Select all merge candidates:
1.a) When I select a target, mark all candidates
1.b) If I double-click a target, mark all candidates
2) Order candidates by string ID (I always keep lowest number, because of the nature of the bug, where ID of new duplicates is always larger)
3) Ignore DropDownItem.ID (and other similar ID fields) for translation scanning (I know you rather not, since .NET is marking the properties for localization - for only god knows what reason)

Sorry for posting this bug in this thread, but seems kind of related - above issue is really bugging me, because I have to do the same work so many times. That's not something developers like ;-)

Nick