0

I am trying to add two localization resource files into my MVC3 App_GlobalResources.

I add Global.resx and then Gloabl.fr.resx. However, only the first one generates code in .designer.cs. The second one just generate an empty file.

Can anybody help me out?

Thanks a lot.

1 Answer 1

1

That is how its supposed to work. The .designer.cs class is a strongly typed class so that you can type.

@Global.mystring and it will return a localised (depending on the UICulture) string.

The designer file doesn't actually contain the localised strings, it just contains a bunch of properties which (in turn) return the localised string.. this is why you wouldn't need more than one class.

Perhaps you are trying to find a way of retrieving the resources for different cultures e.g. fr?

You need to set the UICulture to "fr". Either manually or by setting the following element in the web config:

<globalization culture="auto" uiCulture="auto"/>

This would do it automatically based on your browser settings

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.