| BCGControlBar for .NET > How To > Localization |
BCGControlBar Library for .NET is designed to use it's own localization model, not the standard .NET localization. However it is still possible to use standard localization model for standard controls.
- Add component BCGSoft.Localization.Localizer to your form at Design time.
- Select component Localizer and click "Generate" Verb. You'll see "Save File" dialog.
- Type file name, choose location and save .xml file.
- Translate this .xml file into needed languages
- When you handle changing locale event within your application , you can use those static methods to pass .xml content for BCGControlBar controls and components localization:
static void ApplyLocaleFile (String^ xmlFile);
static void ApplyLocale (String^ xmlContent);
e.g.
void OnLocaleChanged ()
{
String fileName = "English.xml"
Localizer.ApplyLocaleFile(fileName);
}
For more details, please see our example: LocalizationSample.
To localize internal forms and strings within the library you have to use BCGSoft.Shared.Localization project.
- Create copies of files Resource.resx and StringResource.resx.
- Rename them according to the languages and include them into the project. E.g. Resource.ru-Ru.resx, StringResource.ru-Ru.resx
- Translate strings within these files.
- Build new BCGSoft.Shared.Localization assembly.