4D v16.3Get localized document path |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
Get localized document path
Get localized document path
The Get localized document path command returns the complete (absolute) pathname of a document designated by relativePath and located in a xxx.lproj folder. This command must be used within a multi-language application architecture based on the presence of a Resources folder and xxx.lproj subfolders (where xxx represents a language). With this architecture, 4D automatically supports localized files of the .xliff type as well as pictures, but you may need to use the same mechanism for other types of files. Pass the relative pathname of the document to be searched for in relativePath. The path entered must be relative to the first level of the "xxx.lproj" folder of the database. The command will return a complete pathname using the "xxx.lproj" folder corresponding to the current language of the database. Note: The current language is either set automatically by 4D according to the contents of the Resources folder (see the Get database localization command), or via the SET DATABASE LOCALIZATION command). You can express the contents of the relativePath parameter using a system or a POSIX syntax. For example:
The absolute pathname returned by the command is always expressed in the system syntax. 4D Server: In remote mode, the command returns the path of the Resources folder on the client machine if the command is called from a client process. 4D looks for the file while respecting a sequence that allows all the cases of multi-language applications to be processed. At each step, 4D checks for the presence of relativePath in the folder corresponding to the language and returns the complete path when it succeeds. If relativePath is not found or if the folder does not exist, 4D passes to the next step. Here are the folders for each of the different search stages: Current language (e.g.: fr-ca) If relativePath is not found in any of these locations, the command returns an empty string. For the purpose of transforming an XML or HTML file, you want to use a "log.xsl" transformation file. This file differs depending on the current language. You therefore want to know which "log.xsl" file path to use. To use a .xsl file adapted to the current language, you simply need to pass: $myxsl:=Get localized document path("xsl/log.xsl") If the current language is, for example, French Canadian (fr-ca), the command returns:
See also
|
PROPERTIES
Product: 4D
HISTORY
Created: 4D v12 TAGS xliff, localisation, traduction, Resources folder ARTICLE USAGE
4D Language Reference ( 4D v16) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||