System.SysUtils.GetLocaleFile
Delphi
function GetLocaleFile(const FileName: string): string;
C++
extern DELPHI_PACKAGE System::UnicodeString __fastcall GetLocaleFile(const System::UnicodeString FileName);
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Returns a fully qualified path that indicates a locale file. The path is constructed with the supplied filename and the preferred UI language subdirectories.
GetLocaleFile performs the following operations:
- The directory and the basename are extracted from the FileName parameter.
- The locale directory that corresponds to any of the preferred UI languages is searched in directory. If such a directory is found, then its fully qualified name concatenated with basename is returned, otherwise the fully qualified name of the FileName parameter is returned.
Example
Suppose that the current directory contains a directory named loc with the following structure:
- ab [directory]
- en [directory]
- en-US [directory]
- F.LC [file]
- ro [directory]
and the current preferred UI language list (see PreferredUILanguageList) contains:
- EN-US
- EN
In this case, if GetLocaleFile is called with the loc\F.LC parameter, the following string is returned:
<current directory>\loc\EN-US\F.LC
You can see that the returned string contains the \EN-US
subdirectory.