CRM_Core_Resources_Strings
in package
Manage translatable strings on behalf of resource files.
Tags
Table of Contents
Properties
- $cache : CRM_Utils_Cache_Interface|null
- Cache.
Methods
- __construct() : mixed
- extract() : array<string|int, mixed>
- Extract a list of strings from a file.
- flush() : mixed
- Flush the cache of translated strings.
- get() : array<string|int, mixed>
- Get the strings from a file, using a cache if available.
Properties
$cache
Cache.
private
CRM_Utils_Cache_Interface|null
$cache
= \NULL
Methods
__construct()
public
__construct(CRM_Utils_Cache_Interface $cache) : mixed
Parameters
- $cache : CRM_Utils_Cache_Interface
-
Localization cache.
extract()
Extract a list of strings from a file.
public
extract(string $file, string $format) : array<string|int, mixed>
Parameters
- $file : string
-
File path.
- $format : string
-
Type of file (e.g. 'text/javascript', 'text/html').
Tags
Return values
array<string|int, mixed> —List of translatable strings.
flush()
Flush the cache of translated strings.
public
flush() : mixed
get()
Get the strings from a file, using a cache if available.
public
get(string $bucket, string $file, string $format) : array<string|int, mixed>
Parameters
- $bucket : string
-
The name of a cache-row which includes strings for this file.
- $file : string
-
File path.
- $format : string
-
Type of file (e.g. 'text/javascript', 'text/html').
Tags
Return values
array<string|int, mixed> —List of translatable strings.