include/SugarObjects/LanguageManager.php
Functions
\LanguageManager
Language files management
- Api
Methods
_clearCache(
string $module_dir
=
'', string $lang
)
:
void
PRIVATE function used within clearLanguageCache so we do not repeat logic
Name | Type | Description |
---|---|---|
$module_dir | string | module_dir the module_dir to clear |
$lang | string | lang the name of the language file we are clearing this is for sugar_cache |
addTemplate(
$module, $lang, $template
)
:
void
Name | Type | Description |
---|---|---|
$module | ||
$lang | ||
$template |
clearLanguageCache(
string $module_dir
=
'', string $lang
=
''
)
:
void
clear out the language cache.
Name | Type | Description |
---|---|---|
$module_dir | string | module_dir the module_dir to clear, if not specified then clear clear language cache for all modules. |
$lang | string | lang the name of the object we are clearing this is for sugar_cache |
createLanguageFile(
\module $module, \templates $templates
=
array('default'), $refresh
=
false
)
:
void
Called from VardefManager to allow for caching a lang file for a module
Name | Type | Description |
---|---|---|
$module | \module |
|
$templates | \templates |
|
$refresh |
getLanguageCacheKey(
$module, $lang
)
:
string
Return the cache key for the module language definition
Name | Type | Description |
---|---|---|
$module | ||
$lang |
Type | Description |
---|---|
string |
- Static
loadModuleLanguage(
$module, $lang, $refresh
=
false
)
:
void
Name | Type | Description |
---|---|---|
$module | ||
$lang | ||
$refresh |
loadTemplateLanguage(
\module $module, \templates $templates, \lang $lang, \loaded_mod_strings $loaded_mod_strings
)
:
void
Load the module tempalte lauguage files
Name | Type | Description |
---|---|---|
$module | \module |
|
$templates | \templates |
|
$lang | \lang |
|
$loaded_mod_strings | \loaded_mod_strings |
|
refreshLanguage(
string $module, string $lang, $loaded_mod_strings
=
array(), array $additional_search_paths
=
null
)
:
void
Given a module, search all of the specified locations, and any others as specified in order to refresh the cache file
Name | Type | Description |
---|---|---|
$module | string | the given module we want to load the vardefs for |
$lang | string | the given language we wish to load |
$loaded_mod_strings | ||
$additional_search_paths | array | an array which allows a consumer to pass in additional vardef locations to search |