Loading...
 

Multi-Language Add-In for Visual Studio


Translating "Culture" not supported (MVC)

The text "Culture" cannot be translated because there is already a property called "Culture" returning the "CultureInfo".

I will suggest 2 solutions:

  1. Rename "CultureInfo Culture" into something unlikely to conflict (like "CultureInfo _Culture")
  2. Rename "string Culture" into something unlikely to conflict (like "string _Culture")

Hi Phil,

Do you need more information about this issue?


Germany

Sorry that I didn't react to this question.

I didn't know about this problem, but I have seen similar problems when a text corresponds exactly to a keyword in C#, like event or public.

You can fix it in Multi-Language, but I admit it is non-intuitive and I don't know whether it is documented anywhere.

If you go to the resources tab, you can modify the resource name by clicking in the left hand column and editing it. The change is automatically used in the source code.

Image

It would probably be a good idea if I defined a list of words which should not be used as resource names.

Phil


Hey Phil and thanks for looking into this biggrin

Defining such list makes sense - and while you are at it, if your code auto-generate a resource name that's on this new list, you could auto generate a different name (e.g. adding "0", "1", "2",... as suffix to make it unique) wink

Just an idea so developer doesn't have a manual task finding this issue and another manual task fixing the issue cool

Germany

I have added a keyword list in version 6.02.0007.

The list contains keywords from C# and VB, plus the words Culture and ResourceManager which are public members in the Resource class.

If there is a conflict, Multi-Language prefixes the name with an underscore.

Phil

Hi Phil,

This sounds Perfect! Thanks a lot!