Skip to content

Selecting Your Language

This section will use the symbol ** to represent the name of the language you are selecting.

First, you need to determine if your language is currently supported. The best way to do that is to open the file in your pkg folder named LanguageText.pkg. The top of the file will list all supported languages and should contain something like the following:

Enumeration_list
    define Language$English
    define Language$Nederlands
    define Language$Svenska
    define Language$Deutsch
    define Language$Dansk
    define Language$Portugues
    define Language$Francais
    define Language$Italiano
    define Language$Espanol
    define Language$Norsk
    Define Language$Russian
    Define Language$Polish
    Define Language$Hungarian
End_Enumeration_List

If your language is not supported, you need to go to the next section, add the language, then come back here.

If your language is supported, you should have a set of files in subfolders in a folder created for your language. We will refer to that as your “language folder”. Those files are located in usr\language\**. You will need to copy files from this folder into various other folders where the current version of DataFlex is installed. We will refer to the folder where the current version of DataFlex is installed as your “DataFlex folder” and any reference to DataFlex\FolderName is a reference to FolderName beneath the DataFlex folder.

Steps to Perform on All Systems Running DataFlex

The following steps must be performed on any system running your application, for development and runtime use.

Run the Correct Regional Version of Windows

Some of the text provided in your application comes from Windows. The message boxes (used for errors, confirmations, etc.), the open file dialogs, and much more get their language text from Windows. When you run your application, you will want to run it on the proper version of Windows or your translation will be mixed.

Installing Your Error Tables

  1. First, make sure you copy all error tables in your DataFlex\usr folder to some other safe location. Copy flexerrs.dat and dferr???.dat.

  2. Copy all error tables from the language folder into your DataFlex\usr folder. Copy flexerrs.dat and dferr???.dat.

  3. If you are not using a custom version of flexerrs, you are done.

  4. If you are using a custom version of flexerrs, you are going to need to make sure that your custom errors are properly merged into the translated table. Some developers maintain a single customized flexerrs in DataFlex\usr while others may maintain custom flexerrs in each workspace. If you have customized error tables, you must make sure they are up to date.

Installing Your Collate File

If your language requires a special df_collate.cfg, you will want to install this into your DataFlex\bin folder and then re-sort all your databases.

  1. Make sure you have copied the current df_collate.cfg in DataFlex\bin to a safe location.

  2. Copy the df_collate.cfg from your language\bin folder to the DataFlex\bin folder. You must make sure that this file resides in your DataFlex\bin folder and that no copies of it exist in any other path that can be found with dfpath.

  3. Resort all database tables.

Any time you install a new df_collate.cfg you will need to re-sort all your tables. These tables can be sorted from Database Builder.

Note: Earlier versions of DataFlex used a file named collate.cfg. The proper file name is now df_collate.cfg.

Installing Your WinPrintViewer.ini File

If your application uses WinPrint reports, you will want to install the translated WinPrintViewer_.ini file into your DataFlex\bin folder as WinPrintViewer.ini. This file controls the text of controls in the WinPrint viewer.

  1. Make sure you have copied the current WinPrintViewer.ini in DataFlex\bin to a safe location.

  2. Copy the WinPrintViewer_.ini from your language\bin folder to the DataFlex\bin folder and rename it to WinPrintViewer.ini.

Steps to Perform on Development Systems

The following steps must be performed on your development PC. This ensures that your compiled application will contain text in the appropriate language.

Installing Your Text Language Files

  1. Your language folder should contain a number of .inc and .pkg files in the \pkg folder that need to be copied to your DataFlex\pkg folder. These all have unique names so you should not have to worry about copying over files from a different language. These files may already be copied into your DataFlex\pkg folder. If they are not, copy them.

List of files to install into your DataFlex\pkg folder for all DataFlex applications:

  • Language_**.inc
  • Language_DD_**.inc

List of files to install into your DataFlex\pkg folder for DataFlex Web applications:

  • Language_WebApp_***.inc

List of files to install into your DataFlex\pkg folder for DataFlex Windows applications using WinPrint reports:

  • Language_Winprint_**.inc

List of files to install into your DataFlex\pkg folder for DataFlex Windows applications using legacy menus (menus that do not use Codejock classes):

  • DefaultToolbar_**.pkg
  • DfStdBtn_**.pkg
  • File_pm_**.inc
  • Help_pm_**.inc
  • Helpa_pm_**.inc
  • Navi_pm_**.inc
  • Win_pm_**.inc

  • Your language folder should contain a number of template (.tpl) files in the \pkg\config folder that need to be copied to your DataFlex\pkg\config folder. These all have unique names so you should not have to worry about copying over files from a different language. These files may already be copied into your DataFlex\pkg\config folder. If they are not, copy them.

List of files to install into your DataFlex\pkg\config folder for DataFlex Windows applications:

  • DefaultCommandBarSystem.tpl
  • TestWindowsProject.tpl
  • WindowsProject.tpl

List of files to install into your DataFlex\pkg\config folder for DataFlex Windows applications using legacy menus (menus that do not use Codejock classes):

  • TestWindowsProjectOldMenus.tpl
  • WindowsProjectOldMenus.tpl

  • The file Language_Current.inc defines which language you are currently using. This file is located in the DataFlex\pkg folder and can be loaded in the Studio and changed. Simply change the define command to use your language. This is what Language_Current.inc might look like:

// define current language. Included by LanguageText.pkg or LanguageTextWebApp.pkg
// (see LanguageText.pkg for a list of supported languages).
Define Language$Current for
    Language$Nederlands
#Include Language_English.inc
  1. Pre-compile all packages.

A Note on the Text Translation Files

The files Language_.inc, Language_Winprint_.inc, and Language_DD_.inc contain a list of all text used by our packages. Our packages now use text symbols (e.g., C_$Cancel) instead of text (e.g., “Cancel”). These include files provide the translation (e.g., #REPLACE C_$Cancel |CS"Cancel"). This makes it easy to provide text for various languages.

When you write your programs, we do not expect that you will need to use these kinds of symbols in your application. You would only need to do that if you are writing an application or sets of packages that need to be multi-lingual. Therefore, you will not need to change the way you are writing your applications.

You are now done.

See Also

Language Translation Guide