Localizing Active Query Builder

The new version 1.7 of Active Query Builder ActiveX and VCL Editions and Active Query Builder .NET Edition since version 1.1.5 have ability to localize the component and to switch between languages in run-time.


Available languages

Currently there are a few languages available, but you can make your own translation with ease and apply it to the component immediately!

ActiveX and VCL Editions:


Selecting language

There are two ways to select language. First is to select it from the list of available languages. If you can not find your language in this list, you may localize the component by yourself and load your language from .lng file.

  • Selecting language in VCL Edition (Delphi):

         // use this unit to get access to acQBLanguageManager global object
         uses acQBLocalizer;
     
         // show languages
         for i:=0 to acQBLanguageManager.LanguagesCount-1 do
         begin
             ShowMessage(acQBLanguageManager.Language[i].LanguageName);
         end;
    
         // set built-in default language
         acQBLanguageManager.CurrentLanguageIndex := -1;
    
         // set language #0
         acQBLanguageManager.CurrentLanguageIndex := 0;
    
         // load and apply custom language from file (lng is integer)
         lng := acQBLanguageManager.AddLanguageFromFile('MyLanguage', 'MyLang.lng');
         acQBLanguageManager.CurrentLanguageIndex := lng;
    
         // load and apply language from resource 
         // (lng is integer, MyLang is resource name, LANGUAGES is resource type)
         lng := acQBLanguageManager.AddLanguageFromResource('MyLanguage', 'MyLang', 'LANGUAGES');
         acQBLanguageManager.CurrentLanguageIndex := lng;
    
         // load and apply language from string (lng is integer, sLanguage is string)
         lng := acQBLanguageManager.AddLanguageFromString('MyLanguage', sLanguage);
         acQBLanguageManager.CurrentLanguageIndex := lng;
    
         // load and apply language from TStrings (lng is integer, ssLanguage is TStrings)
         lng := acQBLanguageManager.AddLanguageFromStrings('MyLanguage', ssLanguage);
         acQBLanguageManager.CurrentLanguageIndex := lng;
    

  • Selecting language in ActiveX Edition (VB.NET):

        ' show languages
        For i = 0 To ActiveQueryBuilderX1.Localizer.Count - 1
            MsgBox "Language #" + Str(i) + ": " + ActiveQueryBuilderX1.Localizer.LanguageName(i)
        Next i
    
        ' set built-in default language
        ActiveQueryBuilderX1.Localizer.CurrentLanguage = -1
    
        ' set language #0
        ActiveQueryBuilderX1.Localizer.CurrentLanguage = 0
    
        ' load and apply custom language from file
        lng = ActiveQueryBuilderX1.Localizer.AddLanguageFromFile("MyLanguage", "MyLang.lng")
        ActiveQueryBuilderX1.Localizer.CurrentLanguage = lng
    
        ' load and apply custom language from string (sLanguage is string)
        lng = ActiveQueryBuilderX1.Localizer.AddLanguageFromString("MyLanguage", sLanguage)
        ActiveQueryBuilderX1.Localizer.CurrentLanguage = lng
    

  • Selecting language in ActiveX Edition (C#):

        // show languages
        for (int i = 0; i < axActiveQueryBuilderX1.Localizer.Count; ++i)
        {
            MessageBox.Show("Language #" + i.ToString() + ": " + 
            axActiveQueryBuilderX1.Localizer.get_LanguageName(i));
        }
    
        // set built-in default language
        axActiveQueryBuilderX1.Localizer.CurrentLanguage = -1;
    
        // set language #0
        axActiveQueryBuilderX1.Localizer.CurrentLanguage = 0;
    
        // load and apply custom language from file
        int lng = axActiveQueryBuilderX1.Localizer.AddLanguageFromFile("MyLanguage", "MyLang.lng");
        axActiveQueryBuilderX1.Localizer.CurrentLanguage = lng;
    
        // load and apply custom language from string (sLanguage is string)
        int lng = axActiveQueryBuilderX1.Localizer.AddLanguageFromString("MyLanguage", sLanguage);
        axActiveQueryBuilderX1.Localizer.CurrentLanguage = lng;
    

  • Selecting language in .NET Edition:

        // How to load a language from an external source:
    
        // load language from specified file
        ActiveDatabaseSoftware.ActiveQueryBuilder.Helpers.Localizer.LoadLanguageFromFile(string languageFile);
        // load language from a XML string
        ActiveDatabaseSoftware.ActiveQueryBuilder.Helpers.Localizer.LoadLanguageFromString(string xmlString);
        // load language from a stream containing an XML string
        ActiveDatabaseSoftware.ActiveQueryBuilder.Helpers.Localizer.LoadLanguageFromStream(Stream languageStream);
    
        // How to get a list of available languages:
        foreach (string lng in ActiveDatabaseSoftware.ActiveQueryBuilder.Helpers.Localizer.Languages)
        {
            Trace.WriteLine(lng);
        }
    
        // The language list always contains "Auto" and "Default" strings.
        // - "Auto" means the language will be detected automatically according to CultureInfo specified for 
        //   UI culture of the current thread (System.Threading.Thread.CurrentThread.CurrentUICulture).
        // - "Default" means usage of default strings containing in embedded resources.
    
        // How to set current language:
        ActiveDatabaseSoftware.ActiveQueryBuilder.Helpers.Localizer.Language = "es-MX";
        // If specified language doesn't exist, Localizer will try to fallback to the base language ("es")
        // If it doesn't exist too, the Localizer will use the "Default" language.
    




  • Localizing Active Query Builder .NET Edition

    Please find the 'en.xml' file in the installation directory and translate it to your language using any XML editor you like.

    Localizing Active Query Builder VCL and ActiveX Editions

    We will be grateful if you could send us your translation. In consideration of your efforts, we may implement your wishes foremost, provide significant discount to purchase Active Query Builder; we may also indicate you as an author of translation at this page.

    We recommend the following way to localize Active Query Builder:

    • Download and install the component and find the 'English.lng' file in 'Languages' directory.

    • Download and install IniTranslator application for fast and easy translation.

    • Open 'English.lng' file as Original. We also recommend you to set highlighted IniTranslator options as shown on the screenshot:
      IniTranslator options

    • Now you may start to translate. Below are the form screenshots intended to ease translation process. Each section of .lng file represents a form (window), except the [Active Query Builder] section that contains common strings used in Active Query Builder (popup menus, grid captions, error messages, etc.).

    • If you find that some of translated strings doesn't fit the form, try to cut the string, or tell us about this case so we can allocate more space on the form for it.

    • There are two strings in the [General Settings] section that should be set in exact matching to your language: 'CharSet' and 'BiDiMode'. First item specifies required character set of the font and second specifies the bi-directional mode of controls. All possible values are listed in the comments in 'English.lng' file, so all you need is to uncomment settings that fit your language and copy them to your translation file.

    • Important notice: When saving your translation in IniTranslator, please select the "File" -> "Save Translation As..." item from main menu and choose 'ANSI' from the Encoding combobox at the bottom.
      Select ANSI Encoding

    Sections of .lng file

    [TacDatasourcePropsForm] - This form represents properties of any data source object in the query.
    Datasource Properties

    [TacLinkPropsForm] - This form represents options of JOIN clause.
    Link Properties

    [TacQueryPropsFbForm], [TacQueryPropsIbForm] - These forms represent common properties of InterBase and Firebird SQL queries.
    InterBase/Firebird Query Properties

    [TacQueryPropsSbForm] - This form represents common properties of Sybase SQL queries.
    Sybase Query Properties

    [TacQueryPropsMSForm] - This form represents common properties of MS SQL Server queries.
    SQL Server Query Properties

    [TacQueryPropsMYForm] - This form represents common properties of MySQL queries.
    MySQL Query Properties

    [TacAddObjectForm] - This form is used to add objects to the query.
    Add Object Form

    [TacProcedureParams] - This form required to get input parameter values of stored procedures and functions.


    Actually, this will be enough to localize end-user interface of Active Query Builder, so you may stop here, if you don't want to show any of setup windows listed below to end-users. Just copy the rest of the original file to your translation, and that's all.

    [TfMetadataContainerEditor] - This form is used to manage objects stored in Metadata Container.
    Metadata Container Editor

    [TfacQBMetadataContainerLoad] - This wizard is used to load metadata to Metadata Container. It consists of the following steps:
    Step 1. Welcome message.
    Load Metadata Wizard Step 1
    Step 2. Selecting SQL Syntax.
    Load Metadata Wizard Step 2
    Step 3. Selecing Connection Type.
    Load Metadata Wizard Step 3
    Step 4. Specifying connection options.
    Load Metadata Wizard Step 4
    Step 5. Selecting databases.
    Load Metadata Wizard Step 5
    Step 6. Specifying additional fintration.
    Load Metadata Wizard Step 6
    Step 7. Loading Metadata.
    Load Metadata Wizard Step 7

    [TfrAcQBBDEConnectionEdit] - BDE Connection Options. This frame is used internally in the Load Metadata Wizard on the fourth step.
    BDE Connection Options

    [TfrAcQBADOConnectionEdit] - ADO Connection Options. This frame is used internally in the Load Metadata Wizard on the fourth step.
    ADO Connection Options

    [TfrAcQBdbExConnectionEdit] - dbExpress Connection Options. This frame is used internally in the Load Metadata Wizard on the fourth step.
    dbExpress Connection Options

    [TfrAcQBIBExConnectionEdit] - IbExpress Connection Options. This frame is used internally in the Load Metadata Wizard on the fourth step.
    IbExpress Connection Options
    IbExpress Connection Options

    [TfrFilterEditor], [TfEditMetadataFilter] - This form is intended to define metadata filters. You should call the EditMetadataFilter method to open this form.
    Edit Metadata Filter Form

    [TfmAQBOptions] - This form is the second page of the Properties window. You should call the EditProperties method to open this form.
    Visual Options

    [TSQLFormatFrame], [TfmSQLBuilderOptions] - This form and its frame are the third page of the Properties window.
    SQL Builder Options

    [TfmAQBOptions2] - This form is the first page of the Properties window.
    Non-visual Options

    News

    Testimonial

    With users expecting better and better interfaces to deal with complex data retrieval, Active Query Builder has allowed me to provide a highly professional, robust environment to both novice users and skilled query writers.

    Thanks to all the team involved. Please keep up the good work.
    CodeGear - Where Developers Matter