Localization
To change the default English localization provider you should use the CurrentProvider static property of the SpreadsheetLocalizationProvider class. For example, you can load the string from a XML file like this:
public void FileProvider()
{
SpreadsheetLocalizationProvider.CurrentProvider = SpreadsheetLocalizationProvider.FromFile(@"C:\SpreadSheedStringsFile");
}You can download a XML file that contains all the currently used strings from here: Strings file
SpreadsheetLocalizationProvider contains all strings related to the RadSpreadsheetRibbonBar as well.
AI Assistant Localization Strings
The following table lists all localization strings used by the AI Assistant feature:
| Localization String | Default Value |
|---|---|
Spreadsheet_AI_AuthorName | Spreadsheet AI |
Spreadsheet_AI_WelcomeMessage | Hello! I am your AI assistant. Ask me anything about this spreadsheet. |
Spreadsheet_AI_ProviderNotConfigured | AI provider is not configured. Please set the AIToolsProvider property. |
Spreadsheet_AI_InputBoxWatermark | Ask me anything... |
Spreadsheet_AI_ThinkingWatermark | AI is thinking... |
Spreadsheet_AI_ErrorProcessingRequest | An error occurred while processing your request. |
Custom Localization Provider
Another approach is to create a custom localization provider class which inherits SpreadsheetLocalizationProvider. In it you should just override the GetLocalizedString method and return the localized string depending on current id.
public class MySpreadsheetLocalizationProvider : SpreadsheetLocalizationProvider
{
public override string GetLocalizedString(string id)
{
switch (id)
{
//----------------------
case "Spreadsheet_Workbook":
return "Spreadsheet Workbook";
//----------------------
}
return base.GetLocalizedString(id);
}
}The following code snippet shows how you can use the new class:
public Localization()
{
SpreadsheetLocalizationProvider.CurrentProvider = new MySpreadsheetLocalizationProvider();
InitializeComponent();
}It is necessary to set the SpreadsheetLocalizationProvider. CurrentProvider property before initializing the components.