May 16, 2008
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
6 Comments |
Multilingual & Localization, Sharepoint | Tagged: Multilingual, resources, Resx, Sharepoint, Wss |
Permalink
Posted by amrox
May 4, 2008
In the languages worked left-to-right (like Arabic) its not working well. (see the photos) You will notice that the words will not have the right order.

Also there are some bugs in the graphics in case of right-to-left:

2 Comments |
Multilingual & Localization, Sharepoint, Uncategorized | Tagged: Arabic Support, bugs, Sharepoint |
Permalink
Posted by amrox
May 4, 2008
-
First you need to have your resource files. Place them directly under the project node. For Example add:
-
MyResource.resx
Add a new resource entry in the file:
Key: category – Value: MyNewCategory
Key: property – Value: MyNewProperty
Key: description – Value: MyNewDescription
-
MyResource.ar-sa.resx
Add a new resource entry in the file:
Key: category – Value: MyNewCategory
Key: property – Value: MyNewProperty
Key: description – Value: MyNewDescription
Take care that these resources files must be embedded resources.
Place the following attribute before the class:
[XmlRoot(Namespace = "projectname")]
- Now you have to override the LoadResource function to get the data from your resource files:
- public
override
string LoadResource(string id)
{
ResourceManager rm = new
ResourceManager(“projectname.MyResource”, this.GetType().Assembly);
return rm.GetString(id);
}
- Before the property you place the “ResourcesAttribute” attribute like the following
[ResourcesAttribute(
"property",
"category",
"description")]
[WebPartStorage(Storage.Shared)]
[Browsable(true)]
public string MyProp_Localized
{
get
{
return _ MyProp_Localized;
}
set
{
_MyProp_Localized = value;
}
}
To deploy this web part, use the regular procedure of deploying web part. But you must take care that you will need to deploy the every resources dlls in “..\bin\debug” subdirectory to the Global Assembly Cash (in” windows\assembly” directory). You will find a subdirectory for each culture you have in the project under this directory you will find a projectname.resources.dll file you have to deploy this file to the GAC.
Leave a Comment » |
Multilingual & Localization, Sharepoint, Uncategorized | Tagged: custom property, Localization, Sharepoint, webpart |
Permalink
Posted by amrox
May 4, 2008
-
First you need to have your resource files. Place them directly under the project node. For Example add:
-
MyResource.resx
Add a new resource entry in the file:
Key: hello
Value: Hello
-
MyResource.ar-sa.resx
Add a new resource entry in the file:
Key: hello
Value:أهلا
Take care that these resources files must be embedded resources.
-
In the render function add the following code:
ResourceManager rm = new
ResourceManager(“projectname.MyResources”,this.GetType().Assembly);
writer.Write(rm.GetString(“hello”));
To deploy this web part, use the regular procedure of deploying web part. But you must take care that you will need to deploy the every resources dlls in “..\bin\debug” subdirectory to the Global Assembly Cash (in” windows\assembly” directory). You will find a subdirectory for each culture you have in the project under this directory you will find a projectname.resources.dll file you have to deploy this file to the GAC.
Leave a Comment » |
Multilingual & Localization, Sharepoint, Uncategorized | Tagged: Localization, Multilingual, Resource, Resx |
Permalink
Posted by amrox