|
5 | 5 | [](#does-this-example-address-your-development-requirementsobjectives) |
6 | 6 | <!-- default badges end --> |
7 | 7 |
|
8 | | -# DevExpress VCL Reports — Localize the DevExpress Report Viewer and Report Designer |
| 8 | +# DevExpress Reports for Delphi/C++Builder — Localize the Report Viewer and Report Designer |
9 | 9 |
|
10 | 10 | This example localizes DevExpress VCL Reports components. |
11 | 11 |
|
12 | | -The [DevExpress Reporting Platform](https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports) fully supports UI localization. |
13 | | -The localization example in this repository allows users to select between English (default) and German (localized) versions of two built-in DevExpress dialogs: |
14 | | -[Report Viewer](https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer) and |
15 | | -[Report Designer](https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer). |
| 12 | +The [DevExpress Reports for Delphi/C++Builder][vcl-reports-intro] fully support UI localization. |
| 13 | +The localization example in this repository allows users to select between English (default) and German (localized) versions |
| 14 | +of two built-in DevExpress dialogs: [Report Designer][dx-report-designer] and [Report Viewer][dx-report-viewer]. |
16 | 15 | The example includes projects for both [Delphi](./Delphi) and [C++Builder](./CPB). |
17 | 16 |
|
18 | | -<img width="450" src="./images/Lokalisierungsbeispiel.png" |
| 17 | +> <img width="450" src="./images/Lokalisierungsbeispiel.png" |
19 | 18 | alt="Start screen of the localization example, allowing users to select between English and German, |
20 | 19 | and to display Report Designer and Report Viewer dialogs" /> |
21 | 20 |
|
22 | 21 | ## Prerequisites |
23 | 22 |
|
24 | | -See the [DevExpress Reports Prerequisites]( |
25 | | -https://docs.devexpress.com/VCL/405773/ExpressCrossPlatformLibrary/vcl-backend/reports-dashboards-app-deployment#vcl-reportsdashboards-prerequisites). |
| 23 | +[DevExpress Reports Prerequisites][req] |
| 24 | + |
| 25 | +[req]: https://docs.devexpress.com/VCL/405773/ExpressCrossPlatformLibrary/vcl-backend/reports-dashboards-app-deployment#vcl-reportsdashboards-prerequisites |
26 | 26 |
|
27 | 27 | ## Implementation Details |
28 | 28 |
|
29 | 29 | To localize the DevExpress Report Designer and Report Viewer in your Delphi or C++Builder application, |
30 | 30 | you must: |
31 | 31 |
|
32 | | -1. Use the [DevExpress UI Localization Service](https://docs.devexpress.com/GeneralInformation/16235/localization/localization-service) |
| 32 | +1. Use the [DevExpress UI Localization Service][localization-service] |
33 | 33 | to obtain localization files for DevExpress VCL Report Viewer and Designer. |
34 | 34 | These files contain UI string translations for specific languages/locales. |
35 | 35 | Refer to the following guide to learn more: |
36 | | - [Localize Core Reporting Components: Use JSON Files](https://docs.devexpress.com/XtraReports/400932/web-reporting/common-features/localization/localization-in-asp-net-core-reporting-applications#use-json-files). |
37 | | -1. Extract downloaded files to a `Localization` folder next to your compiled application executable. |
| 36 | + [Localize Core Reporting Components: Use JSON Files][l10n-json-files]. |
| 37 | +1. Extract downloaded files to a [Localization] folder next to your compiled application executable. |
38 | 38 | Note that projects in this repository output their executables to the same location. |
39 | 39 | This allows both projects to use the same localization files. |
40 | | -1. Assign a language identifier (also known as [locale][1] or [culture identifier][2]) to the |
41 | | - [`TdxReport.Language`](https://docs.devexpress.com/VCL/dxReport.TdxReport.Language) |
| 40 | +1. Assign a language identifier (also known as [locale][locale] or [culture identifier][culture]) to the |
| 41 | + [TdxReport.Language] |
42 | 42 | property to switch the Report Designer/Report Viewer to the desired language: |
43 | 43 |
|
44 | | - **Delphi:** |
| 44 | + <!-- start-code-block --> |
| 45 | + #### Delphi |
45 | 46 | ```delphi |
46 | 47 | dxReport1: TdxReport; |
47 | 48 | |
48 | 49 | // Switch Report UI to German |
49 | 50 | dxReport1.Language := 'de-DE' |
50 | 51 | ``` |
51 | 52 |
|
52 | | - **C++Builder:** |
53 | | - ```cpp |
| 53 | + #### C++Builder |
| 54 | + ```c |
54 | 55 | TdxReport *dxReport1; |
55 | 56 |
|
56 | 57 | // Switch Report UI to German |
57 | 58 | dxReport1->Language = "de-DE"; |
58 | 59 | ``` |
59 | | -
|
60 | | -[1]: https://learn.microsoft.com/en-us/globalization/reference/glossary#locale |
61 | | -[2]: https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-globalization-cultureinfo#culture-names-and-identifiers |
| 60 | + <!-- end-code-block --> |
62 | 61 |
|
63 | 62 | For a step-by-step guide, refer to the following help topic: |
64 | | -[Report Viewer and Designer UI Localization](https://docs.devexpress.com/VCL/405598/ExpressReports/localization/vcl-report-viewer-and-designer-localization). |
| 63 | +[Report Viewer and Designer UI Localization][viewer-designer-l10n]. |
65 | 64 |
|
66 | 65 | This example does not localize report content. |
67 | | -To localize report content in your project, refer to the following guide: [Report Localization](https://docs.devexpress.com/VCL/405599/ExpressReports/localization/vcl-report-localization). |
| 66 | +To localize report content in your project, refer to the following guide: [Report Content Localization][report-content-l10n]. |
68 | 67 |
|
69 | 68 | The localization mechanism described in this example applies only to the DevExpress Report Designer and Report Viewer. |
70 | | -Other DevExpress VCL components support localization using [resource files and the Localizer Editor](https://docs.devexpress.com/VCL/154039/ExpressCrossPlatformLibrary/how-to/localize-an-application). |
| 69 | +Other DevExpress VCL components support localization using [resource files and the Localizer Editor][localize-an-application]. |
| 70 | +
|
71 | 71 |
|
72 | 72 | ## Files to Review |
73 | 73 |
|
74 | | -- [`Delphi/uMainForm.pas`](./Delphi/uMainForm.pas) loads an example report from `ExampleReport.repx`. |
75 | | - Event handlers assigned to [`TcxRadioButton`](https://docs.devexpress.com/VCL/cxRadioGroup.TcxRadioButton) |
| 74 | +- [uMainForm.pas] (Delphi) and [uMainForm.cpp] (C++Builder) load an example report from [ExampleReport.repx]. |
| 75 | + Event handlers assigned to [TcxRadioButton] |
76 | 76 | components switch localization language between English and German. |
77 | | -- [`Localization/*.de.json`](./Localization/) files contain localized UI strings. |
| 77 | +- [Localization/*.de.json][Localization] files contain localized UI strings. |
78 | 78 |
|
79 | 79 | ## Documentation |
80 | 80 |
|
81 | | -- [VCL Report Viewer and Designer UI Localization](https://docs.devexpress.com/VCL/405598/ExpressReports/localization/vcl-report-viewer-and-designer-localization) |
82 | | -- [VCL Reports Localization](https://docs.devexpress.com/VCL/405597/ExpressReports/vcl-reports-localization) |
83 | | -- [DevExpress UI Localization Service](https://docs.devexpress.com/GeneralInformation/16235/localization/localization-service) |
84 | | -- [TdxReport.Language Property](https://docs.devexpress.com/VCL/dxReport.TdxReport.Language) |
85 | | -- [ExpressReports Application Deployment Requirements](https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports#expressreports-app-deployment) |
| 81 | +- [VCL Report Viewer and Designer UI Localization][viewer-designer-l10n] |
| 82 | +- [VCL Reports Localization][reports-l10n] |
| 83 | +- [DevExpress UI Localization Service][l10n-service] |
| 84 | +- [ExpressReports Application Deployment Requirements][req] |
| 85 | +- API reference: |
| 86 | + - [TdxReport.Language] |
| 87 | +
|
| 88 | +<!-- documentation links --> |
| 89 | +[vcl-reports-intro]: https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports |
| 90 | +[dx-report-viewer]: https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer |
| 91 | +[dx-report-designer]: https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer |
| 92 | +[reports-l10n]: https://docs.devexpress.com/VCL/405597/ExpressReports/vcl-reports-localization |
| 93 | +[report-content-l10n]: https://docs.devexpress.com/VCL/405599/ExpressReports/localization/vcl-report-localization |
| 94 | +[viewer-designer-l10n]: https://docs.devexpress.com/VCL/405598/ExpressReports/localization/vcl-report-viewer-and-designer-localization |
| 95 | +[l10n-service]: https://docs.devexpress.com/GeneralInformation/16235/localization/localization-service |
| 96 | +[l10n-json-files]: https://docs.devexpress.com/XtraReports/400932/web-reporting/common-features/localization/localization-in-asp-net-core-reporting-applications#use-json-files |
| 97 | +[localize-an-application]: https://docs.devexpress.com/VCL/154039/ExpressCrossPlatformLibrary/how-to/localize-an-application |
| 98 | +
|
| 99 | +<!-- reference links --> |
| 100 | +[TdxReport.Language]: https://docs.devexpress.com/VCL/dxReport.TdxReport.Language |
| 101 | +[TcxRadioButton]: https://docs.devexpress.com/VCL/cxRadioGroup.TcxRadioButton |
| 102 | +
|
| 103 | +<!-- external documentation links --> |
| 104 | +[locale]: https://learn.microsoft.com/en-us/globalization/reference/glossary#locale |
| 105 | +[culture]: https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-globalization-cultureinfo#culture-names-and-identifiers |
| 106 | +
|
| 107 | +<!-- in-repository links --> |
| 108 | +[Localization]: ./Localization/ |
| 109 | +[uMainForm.pas]: ./Delphi/uMainForm.pas |
| 110 | +[uMainForm.cpp]: ./CPB/uMainForm.cpp |
| 111 | +[ExampleReport.repx]: ./ExampleReport.repx |
86 | 112 |
|
87 | 113 | ## Localized Report Dialogs Preview |
88 | 114 |
|
|
0 commit comments