Showing posts with label Globalization. Show all posts
Showing posts with label Globalization. Show all posts

Wednesday, December 3, 2008

Include language resources in SharePoint

After reading the blogs Tomblog and Mikhail Dikov on language resources in SharePoint I decided to create a "language aware" version of some SharePoint FieldControls.

In addition I created a function to retrieve the resources that read the resx file if available. If the resourcefile is obsolete (Not published to the App_GlobalResources with ststadm -o copyappbincontent or a feature receiver) The resource will be created from the default resource compiled into the assembly.

Code:

public static String GetResource(String ID)

{

String ResourceString = "";

// Check if the resource exists in the App_Resources folder

// Hint use stsadm -o copyappbincontent to copy the contents from the /CONFIG/Resources directory

// A better way to update the resources is by a feature receiveres

try

{

ResourceString = HttpContext.GetGlobalResourceObject("chandrila_cdlf", ID, SPContext.Current.Web.Locale).ToString();

}

catch

{ }

try

{

if (String.IsNullOrEmpty(ResourceString))

{

// Fall back to the compiled resources

return Resources.chandrila_cdlf.ResourceManager.GetString(ID);

}

else

return ResourceString;

}

catch

{

// If all fails return the ID of the resource that was requested.

return ID;

}

}



Not rocket science, but it helps avoiding strange errors for the SharePoint Adminstrators

Monday, November 24, 2008

Enabling language specific help in SharePoint

When using other variations (languages) in SharePoint, the Help files may not have been installed along with the new language. (In fact I believe that the help files are never installed together with the language)

When a user requests help or seeks information the help system will display a message like the image below


The highlighted area indicates the LCID (Locale ID) that is missing its data.

In order to install the missing files you can use a command located in the SharePoint Root + Bin (12\bin) called Hcinstal.exe this application installs the help files associated with your language.

To install a single language use
Hcinstal.exe /act InstallOneHC /loc 1044 /mns MS.OSS
This will install the help files associated with LCID 1044

The utility will return one of three values to indicate the result of the operation, the codes are as follows:
  • 4 - Success
  • 32 - No action taken
  • 256 - operation failed (ex if you specify an LCID that is not installed)

After running the utility, and getting a return output like "Outcome code is: 4" the help window will now have some language specific content...




It took a while before the users reported this issue, as most "proffessionals" the users don't like to read the manuals. But when using "MySite" one link leads direct to the help files.