Bitrix API

Translation

Table of Contents

Constants

CACHE_ID  = 'TranslationLoadMapCache'
CACHE_TTL  = 3600

Methods

allowConvertEncoding()  : bool
Tells true if configuration allows to convert encodings.
checkPathRestrictionConvertEncoding()  : bool
Tells if need to convert encoding for certain file.
convertLangPath()  : string
Converts lang file to translation repository path.
getCurrentEncoding()  : string
Returns current encoding.
getDefaultTranslationEncoding()  : string
Returns encoding of source lang file in the translation repository.
getDeveloperRepositoryPath()  : string
Returns path to developer repository.
getEncodings()  : array<string|int, mixed>
getSourceEncoding()  : string
Returns encoding of source lang file in the translation repository.
getTranslationRepositoryPath()  : string
Returns path to translation repository.
isDefaultTranslationLang()  : bool
Returns true if language translation is one of the default translation.
loadMap()  : array<string|int, mixed>
Restore project map structure from file structure.
needConvertEncoding()  : bool
Tells if need to convert encoding.
setCurrentEncoding()  : void
Sets current encoding.
useTranslationRepository()  : bool
Tells if need to use translation repository.

Constants

CACHE_ID

public mixed CACHE_ID = 'TranslationLoadMapCache'

Methods

allowConvertEncoding()

Tells true if configuration allows to convert encodings.

public static allowConvertEncoding() : bool
Return values
bool

checkPathRestrictionConvertEncoding()

Tells if need to convert encoding for certain file.

public static checkPathRestrictionConvertEncoding(string $langFile) : bool
Parameters
$langFile : string

Language file path.

Return values
bool

convertLangPath()

Converts lang file to translation repository path.

public static convertLangPath(string $langFile, string $language) : string
Parameters
$langFile : string

Language file path.

$language : string

Language code to retrieve translation.

Return values
string

getCurrentEncoding()

Returns current encoding.

public static getCurrentEncoding() : string
Return values
string

getDefaultTranslationEncoding()

Returns encoding of source lang file in the translation repository.

public static getDefaultTranslationEncoding(string $lang) : string
Parameters
$lang : string

Language code to retrieve encoding.

Return values
string

getDeveloperRepositoryPath()

Returns path to developer repository.

public static getDeveloperRepositoryPath() : string
Return values
string

getEncodings()

public static getEncodings(mixed $language, mixed $langFile) : array<string|int, mixed>
Parameters
$language : mixed
$langFile : mixed
Return values
array<string|int, mixed>

getSourceEncoding()

Returns encoding of source lang file in the translation repository.

public static getSourceEncoding(string $lang) : string
Parameters
$lang : string

Language code to retrieve encoding.

Return values
string

getTranslationRepositoryPath()

Returns path to translation repository.

public static getTranslationRepositoryPath() : string
Return values
string

isDefaultTranslationLang()

Returns true if language translation is one of the default translation.

public static isDefaultTranslationLang(string $lang) : bool
Parameters
$lang : string

Language code to check.

Return values
bool

loadMap()

Restore project map structure from file structure.

public static loadMap() : array<string|int, mixed>
Return values
array<string|int, mixed>

needConvertEncoding()

Tells if need to convert encoding.

public static needConvertEncoding(string $language[, string $targetEncoding = null ]) : bool
Parameters
$language : string

Language code.

$targetEncoding : string = null

Target encoding.

Return values
bool

setCurrentEncoding()

Sets current encoding.

public static setCurrentEncoding(string $encoding) : void
Parameters
$encoding : string

Charset encoding.

useTranslationRepository()

Tells if need to use translation repository.

public static useTranslationRepository() : bool
Return values
bool

        
On this page

Search results