The /lang/ folder is created in the a site template directory:
/bitrix/templates/<>/lang/
The /lang/ folder has the folders with the utilized languages identifiers: /en/, /de/, /fr/, and etc. For example:
/bitrix/templates/<>/lang/fr/
The languages identifiers corresponding to message files are stored within the folders. These files are characterized by the following properties:
the message file name is equal to the file name where this message file is called. For example, if a message file call is implemented in the template header (file header.php) then this message file must have name header.php.
message list in the file is stored the following way:
The code (ID) of calling message is used as the GetMessage() parameter. The function verifies if the connected message file contains necessary message. If the necessary message exists then it is shown to page visitors.