Translator
class Translator
Class Translator Handles loading and translating language strings from various sources.
Properties
| static array | $translations |
Methods
static
init()
Initializes the translations by loading locale files from modules and the project folder.
static
locales_recursive(string $path)
Recursively loads locale files from a given path.
static bool
addPath(string $path)
Adds a new translation path to the list.
static string
translate(string $string, array $placeholders = [])
Translates a string using loaded translations and replaces placeholders.
static
refresh()
Refreshes the translations by re-initializing them.
Details
at line 20
static
init()
Initializes the translations by loading locale files from modules and the project folder.
at line 33
static
locales_recursive(string $path)
Recursively loads locale files from a given path.
at line 63
static bool
addPath(string $path)
Adds a new translation path to the list.
at line 85
static string
translate(string $string, array $placeholders = [])
Translates a string using loaded translations and replaces placeholders.
at line 94
static
refresh()
Refreshes the translations by re-initializing them.