This shows you the differences between two versions of the page.
— |
easyquery:how-to:query-builder-ui-localization-2-x [2012/12/13 19:47] (current) korzh created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Localization of query builder's UI ====== | ||
+ | |||
+ | It is quite easy to translate the user interface of EasyQuery.NET components into another language. | ||
+ | Our help describes how to do it via satellite assemblies which is the standard way of localization for .NET components. | ||
+ | |||
+ | However there is another way: more easy and faster one. | ||
+ | All our main components (like ''DataModel'', ''QueryPanel'' or ''QueryColumnsPanel'') contains special ''Texts'' property which is actually a map of all strings used by this component. You can change those properties one-by-one (through ''Texts.Put'' operation) or simply load a ''.properties'' which contains all translations. | ||
+ | |||
+ | Here are more detailed instructions: | ||
+ | - Find all ''.properties'' files in the **\res\EasyQuery\** sub-folder of EasyQuery.NET installation folder. | ||
+ | - Make a copy of each such file with some language code suffix. For example ''EQCoreMessages.properties'' will become ''EQCoreMessages_PT.properties'' for Portuguese language. After that just translate all text messages at the right part (after = symbol) in each row of all new ''.properties'' files. | ||
+ | - Finally, just load those files somewhere at the beginning of your application e.g. during loading of the form. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code csharp> | ||
+ | DataModel1.Texts.LoadFromFile("EQCoreMessages_PT.properties"); | ||
+ | QueryPanel1.Texts.LoadFromFile("EQWebMessages_PT.properties"); | ||
+ | </code> | ||
+ | |||
+ | |||
+ | For Silverlight components the approach is similar but slightly different. | ||
+ | Instead of changing text resources in each component you can access all of them at once using special ''LocResources'' static class. | ||
+ | |||
+ | Here is an example: | ||
+ | |||
+ | <code csharp> | ||
+ | DataModel1.Texts.LoadFromFile("EQCoreMessages_DE.properties"); | ||
+ | LocResources.LoadFromFile("EQSLMessages_DE.properties"); | ||
+ | </code> | ||
+ | |||
+ | Please note, that for non-visual components (such as DataModel) you still should use the old way of localization (through Texts property). | ||
+ | |||