I have client that wants to specifiy their own version of localized content for a subset of my string resources.
For simplicity here is basic example:
Lets say I have 2 localized strings (showing english content)
PageTitle="Hello World"
PageDescription="This is a more wordy version of Hello World!"
I wish to localize these so I have resource files.
Ideally "Strings.fr-ca-clientX" can specify only the strings they want to "override". In other words they may just wish to change the PageTitle and continue using the PageDescription from the "fr-ca" resource file.
So how do I go about this in .NET? Ideally I would just create the resx file and specify the culture in my "Web.config" and it should work...
<globalization uiCulture="fr-ca-clientX" culture="fr-ca-clientX" />
However, this does not work. "The tag contains an invalid value for the 'culture' attribute" is my first obsticle.
Thanks,
Justin
resx file contains a standard set of header information that describes the format of the resource entries, and specifies the versioning information for the XML code that parses the data. These files contain all the strings, labels, captions, and titles for all text in the three IBM Cognos Office components.
In Visual Studio, open a SharePoint solution. In Solution Explorer, choose a SharePoint project node, and then, on the menu bar, choose Project > Add New Item. In the Add New Item dialog box, choose the Global Resources File template, and then choose the Add button.
public void AddCustomCulture(string cultureName, string baseCulture)
{
var cultureBuilder = new CultureAndRegionInfoBuilder(cultureName, CultureAndRegionModifiers.None);
cultureBuilder.LoadDataFromCultureInfo(new CultureInfo(baseCulture));
var region = baseCulture.Substring(3, 2);
cultureBuilder.LoadDataFromRegionInfo(new RegionInfo(region));
cultureBuilder.Register();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With