Reputation: 33998
In sharepoint in order to have a field translated I have to modify one attribute which is called schemaxml.
When I read it using c# the code I get is something like this:
string schemaXmlWithResourceTokens = recurrentField.SchemaXmlWithResourceTokens;
int startIndex = schemaXmlWithResourceTokens.IndexOf("\"", schemaXmlWithResourceTokens.IndexOf("DisplayName=\"")) + 1;
int endIndex = schemaXmlWithResourceTokens.IndexOf("\"", startIndex);
int substringLength = endIndex - startIndex;
string value = @"DisplayName=\" + schemaXmlWithResourceTokens.Substring(startIndex, substringLength);
schemaXmlWithResourceTokens = schemaXmlWithResourceTokens.Replace(value, @"DisplayName=\$Resources:SPNLMeetings,Field_Recurrent_Name");
recurrentField.SchemaXml = schemaXmlWithResourceTokens;
recurrentField.Update();
The values is not being changed.
Upvotes: 0
Views: 375
Reputation: 2668
Try this:
string value = "DisplayName=\"" + schemaXmlWithResourceTokens.Substring(startIndex, substringLength);
The difference being "DisplayName=\""
instead of @"DisplayName=\"
Upvotes: 1