Resources on Sharepoint Solution

No.of Views777
Bookmarked0 times
Downloads 
Votes0
By  André Lage   On  16 Jun 2010 08:06:06
Tag : SharePoint , Development and Programming
One of the situations I have found some solutions on the Internet, and use the code of texts, without having the possibility to change your content to another language
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

One of the situations I have found some solutions on the Internet, and use the code of texts, without having the possibility to change your content to another language, other than the standard or the "English".

When performing this article Prentis developers to Sharepoint have the ability to deliver its solutions that can be used in several other countries and language than the original.  

SharePoint solution in Visual Studio

Asssociar for the project should be created the folder "<hive> \ 12 \ CONFIG \ Resources \" which will support the files to translate.

[Project Name]. Resx
[Project Name]. PT.resx en-
[Project Name]. US.resx en-

To use resources such as file Features and solutions in support of SharePoint that are in the folder Hive "12" as feature.xml files should be necessary to create the resources folder "<hive> \ 12 \ Resources \ '.

[Project Name]. Resx
[Project Name]. Pt.resx
[Project Name]. En.resx

 

 Image Loading

To use the resources in code we can use the following example

HttpContext.GetGlobalResourceObject ("[Project Name]" "[String name]"). ToString ();

 

Image Loading

To use resources in the XML module

Example feature.xml:
$ Resources: MyResources, MyName

 

Image Loading

Whenever you need to add some text to support directly on the pages "ASPX" or "ASCX, it should come from the resx file.

Example

<% $ Resources: [Project Name], [String name]%> 

 

Image Loading

This Example is shown the architecture of our solution with a picture of how the file structure of Visual Studio will reflect in Sharepoint Solution.

 

Image Loading

Installation and Troubleshooting

After creating the WSP our solution, we can use aa solution Sharepoint Installer in a simple, simple.

 

Image Loading

To use the resources created are saved in the Hive "" \ 12 \ Config \ Resources "will be necessary to copy the folder to Sharepoint Site" c: \ inetpub \ wwwroot \ wss \ VirtualDirectories \ 80 \ App_GlobalResources "going be used to accomplish the translation of Culture Site.
To accomplish this task Microsoft has provided a command to copy these files to the folder in Sharepoint Site

Example

"Stsadm-o copyappbincontent" 

Image Loading

The new resources on "\ 12 \ Config \ Resources" folder are copied to the Sharepoint Site "c: \ inetpub \ wwwroot \ wss \ VirtualDirectories \ 80 \ App_GlobalResources" 

Image Loading

After installing the WSP solution using the site is necessary to activate the Feature for use with UserControl WebPart using Resources. 

Image Loading

Once activated our solution, we can add our WebPart to see the end result, if the site is as English Language Base, then appears in "1033" if the text appears in Portuguese in "2070." 

Image Loading

Done, here I leave attached the solution that they can use to create solutions using Resources.

Conclusion

I hope you enjoyed this solution and that is quite useful, sometimes it is complicated to pass all the ideas I have in mind for the role, but a perfect storm

Sample Project Source

Download source files -276 kb

 
Sign Up to vote for this article
 
About Author
 
André Lage
Occupation-Not Provided
Company-Not Provided
Member Type-Senior
Location-Portugal
Joined date-09 Jun 2010
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top