To add a text from a resource file into your SharePoint ASPX page you have to place this code where ever you want this text to places.
<%$Resources:MyResource, MyName%>
where:
- MyResource: is the resource file name.
-MyName: is the resource entry key.
Your resource files must be placed in this directory:
..\12\CONFIG\Resources\
all resource files in this directory are copied to the global resources for every web application when it’s creating.
if the webapplication already exists place the resources files in this directory:
C:\Inetpub\wwwroot\wss\VirtualDirectories\<port>\App_GlobalResources\
where <port> is the the web application port
July 20, 2008 at 12:09 pm |
thanks for providing this helpful information, I have just one question around placing resource file for existing web application. Do i need to build applilcation and restart IIS each time I add a new resource file or update existing resource file.
thanks,
Gaurav Dixit
August 11, 2008 at 10:59 am |
Yes, you have to reset IIS but no need to rebuild the application.
Sometimes its working even if you didn’t restart the IIS. Its depending on catching technique.
August 12, 2008 at 10:15 am |
i have a problem in make a new language pack for sharepoint 2007
i translate all existing resources on 12 folder, but some text like (welcome, My Site, Site Actions, Cancle{for buttons} and … )don’t translate yet.
where can i find theme and translate to my langauge?
please help me
August 16, 2008 at 6:19 am |
Hello Mehdi.
As I mentioned in the blog. you have to create a new web application to apply that changes in the resource files existing in (12\config\resources) to.
to apply them only after iisreset change them in (C:\Inetpub\wwwroot\wss\VirtualDirectories\\App_GlobalResources\)
Another thing. Some of the error messages and text depending on the .Net framework language and user environment language (but of course site actions is not one of them)
I will check and back to you.
January 13, 2009 at 2:22 pm |
thanks for the post, it helped a lot.
what if i have two resorce files
MyResource
MyResource.nl-NL
what i can do in this case?
January 14, 2009 at 5:20 am |
You just have to add the tag:
as in the post.
and place your two files in the folders discussed above.
according to the site culture you will see the text.