4D v16.3

Get database localization

Home

 
4D v16.3
Get database localization

Get database localization 


 

Get database localization {( languageType )} -> Function result 
Parameter Type   Description
languageType  Longint in Type of language
Function result  String in Current language of the database

The Get database localization command returns the default language or the language of the database specified by the languageType, expressed in the standard defined by the RFC 3066. Typically, the command returns “en” for English, “es” for Spanish, etc. For more information about this standard and the values returned by this command, please refer to Appendix C: XLIFF architecture in the Design Reference manual.

Several different language settings can be used simultaneously in the application. To designate the setting to be obtained, in languageType you can pass one of the following constants, found in the 4D Environment theme:

Constant Type Value Comment
Current localization Longint 1 Current language of the application: default language or language set via the SET DATABASE LOCALIZATION command.
Default localization Longint 0 Language set automatically by 4D on startup according to the Resources folder and the system environment (not modifiable).
Internal 4D localization Longint 3 Language used by 4D for sorts and text comparisons (set in the Preferences of the application).
User system localization Longint 2 Language set by the current user of the system.

By default, if you omit the languageType parameter, the command returns the default language (0).  

The current language of the database can be used to determine the .lproj folder where the program will look for the localized items of the database. 4D automatically determines the current language on database startup according to the contents of the Resources folder and the system environment. How it works is that 4D loads the first .lproj folder of the database that corresponds to the reference language, with the following order of priority:

  1. System language (under Mac OS, several languages can be set by order of preference, 4D uses this setting).
  2. Language of the 4D application.
  3. English
  4. First language found in the Resources folder.

Note: If the database does not have an .lproj folder, 4D applies the following order of priority: 1. System language, 2. English (if the system language cannot be identified).



See also 

Get localized document path
SET DATABASE LOCALIZATION

 
PROPERTIES 

Product: 4D
Theme: 4D Environment
Number: 1009

 
HISTORY 

Created: 4D v11 SQL
Renamed: 4D v12
Modified: 4D v12

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)