Resource file or not Resource file ?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/23/2008 10:11:20 AM
Gravatar
Total Posts 16
Jesuite

Resource file or not Resource file ?

Hi Joe,

When generating an EditForm with CodeSmith Template, I notice the <mp:SiteLabel .../> always have a ConfigKey and a ResourceFile attributs. That's fine !

This suppose to have a Ressource.fr-FR in the APP_GlobalResources. But no way to put the label in the code line or I have'nt found how to do. The problem is that I have thousands of label to setup, and sometime I think I could fire this only by code. But perhaps the Resources file is the good solution thought I did not the result for the end user.

Can you give you opinion ?

Thank you.

G.

4/23/2008 10:44:55 AM
Gravatar
Total Posts 18439

Re: Resource file or not Resource file ?

The SiteLabel control is designed to make it easy to use resource files. You just set the ResourceFile and ConfigKey properties either decalratively in markup or using code. The control will lookup the text to display by finding the key inside the resource file.

Resource.fr-FR.resx would be used for translating core mojoPortal labels to french. You should not put your custom text in there, but instead create a new resource file in your external module and copy it to Web/App_GlobalResources in a post build event.

So you might make a MyCustomApp.resx for english labels and MyCustomApp.fr-FR.resx for French labels. You would set the ResourceFile property on SiteLabel to MyCustomApp, you don't include the fr-FR or the .resx.

See how this is done in the WebStore app? It has WebStore.resx in its own App_GlobalResources folder and this gets copied to Web/App_GlobalResources during post build event.

Hope it helps,

Joe

4/24/2008 6:58:42 AM
Gravatar
Total Posts 16
Jesuite

Re: Resource file or not Resource file ?

Ok, Joe, you're right !

Thank.

 

7/5/2011 9:22:31 AM
Gravatar
Total Posts 88

Re: Resource file or not Resource file ?

Hi,

I have the resource file in web/App_GlobalResources/InstallResources but when the page load de mp:siteLabel can´t load values.

Error:

"Title not found in Resource.resx file"

why Resource.resx  and is not InstallResources.resx?

thanks.

I´ve found the solution.

By default SiteLabel load the resource file as "Resource". To change that change the key ResourceFile="yourResourceName"

 

 

 

 

 

 

You must sign in to post in the forums. This thread is closed to new posts.