Color scheme: Light
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library how-to guides » How to: Choose the language of the components

How to: Choose the language of the components

Show the designers, messages, error descriptions, and screen reader names of the WKL components in one language for every user of an application, whatever language their Office uses.

Requires WKL Forms Object Library 1.54 or later.

Solution overview

The components are available in English, German, Slovenian, Croatian, and Italian. Each database chooses its language; the first match wins:

  1. the language of the application model (WklApplication, key language);
  2. the user interface language of Office (Application.LanguageSettings.LanguageID(msoLanguageIDUI));
  3. the user interface language of Windows;
  4. English.

A language outside the five is skipped, so a French Office falls through to Windows and then to English. Without a model, the components follow Office, as Access itself does; a model with language sets the language for the application.

When the application has texts of its own (How to: Localize an application), its texts take the first of these languages they exist in, in any language, and the components speak that language whenever it is one of their five: with a Slovenian Office, a German Windows and an application with German texts only, the application and the components appear in German.

Implementation

In the application designer (Database Tools › Add-Ins › WKL Application Designer), on the General page, in the Language of the components card, choose a language, or choose Automatic (Office, Windows) to leave the choice to Office and Windows, and then click OK.

In code, in the model you save with WklApplication.Save:

Dim app As Object
Set app = CreateObject("WklForms.Application")
Debug.Print app.Save("{ ""version"": 1, ""title"": ""Customers"", ""language"": ""en"" }")

In a project built with the build tool, the key language belongs to the application model file that appModel in access-app.json names.

Remarks

  • Codes: en, de, sl, hr, it for the components; the model may name any language code in lower case (fr, pl) for the texts of the application, and the components then keep the order above. A regional code such as de-AT counts as its language; Check refuses a value that is no language code.
  • When it takes effect: Save reads the language again immediately; windows that are already open (a designer, a form with a WKL control) keep their texts until they're opened again.
  • For one session: WklTexts.Language sets a language until Access ends, ahead of the model, Office, and Windows - for example to run a test in Slovenian on a German Office. An empty text returns to the order above.
  • Texts of the application appear through WklTexts in the language chosen above; see How to: Localize an application.
  • Error numbers don't change with the language; only Err.Description does. Compare Err.Number in code, never the text.
  • Formats aren't affected: dates, numbers, and the names of months and days follow the Windows regional settings, as everything Access formats does.
  • IntelliSense (the descriptions in the object browser and the VBA editor) stays in English in every language, because VBA reads it from the type library, which exists only once.
  • Excel and Word UserForms have no application model and no Access: there the components follow the user interface language of Windows, then English; the texts of the application come from the language folder that WklTexts.Folder names.
  • WKL Office JSON in the same Access instance uses the language the components chose, once a WKL component has run in the database; before that, it follows Windows.
  • Built-in symbol names (ImageField, DefaultImage) are English in every language; the designer shows them translated. The German names are accepted as well.
  • Names in a German Access. This documentation uses the names of VBA; a German Access shows its own properties and menus in German, and the designers show the language the components chose. The names that occur most:

    In this documentation (VBA)In a German Access or designer
    property sheet, tab Other / Event / DataEigenschaftenblatt, Register Andere / Ereignis / Daten
    ControlSource (Control Source)Steuerelementinhalt
    RecordSource of a formDatensatzquelle
    RecordSource of a WKL control (designer page “Data source”)Datenherkunft
    LinkChildFields, LinkMasterFieldsVerknüpfen von, Verknüpfen nach
    HasModuleEnthält Modul
    Enabled, Locked, TabStopAktiviert, Gesperrt, In Reihenfolge
    AllowEdits, AllowAdditions, AllowDeletionsBearbeitungen zulassen, Anfügen zulassen, Löschen zulassen
    Custom [...] (opens the designer)Benutzerdefiniert
    design view, form viewEntwurfsansicht, Formularansicht
    Tools › References (VBA editor)Extras › Verweise
en/wiki/msaccess/comctl/how-to/choose-the-language-of-the-components.txt · Last modified: by Wolfgang van der Stille