Translation
Table of Contents
Constants
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'
CACHE_TTL
public
mixed
CACHE_TTL
= 3600
Methods
allowConvertEncoding()
Tells true if configuration allows to convert encodings.
public
static allowConvertEncoding() : bool
Return values
boolcheckPathRestrictionConvertEncoding()
Tells if need to convert encoding for certain file.
public
static checkPathRestrictionConvertEncoding(string $langFile) : bool
Parameters
- $langFile : string
-
Language file path.
Return values
boolconvertLangPath()
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
stringgetCurrentEncoding()
Returns current encoding.
public
static getCurrentEncoding() : string
Return values
stringgetDefaultTranslationEncoding()
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
stringgetDeveloperRepositoryPath()
Returns path to developer repository.
public
static getDeveloperRepositoryPath() : string
Return values
stringgetEncodings()
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
stringgetTranslationRepositoryPath()
Returns path to translation repository.
public
static getTranslationRepositoryPath() : string
Return values
stringisDefaultTranslationLang()
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
boolloadMap()
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
boolsetCurrentEncoding()
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