The hTranslations.php helper provides functions for translating strings and managing localization in Osclass. These functions allow you to retrieve and echo translated strings based on language files, handle plural translations depending on a numeric count, and support flash message translations.
__($key, $domain = 'core') – Translate strings. This function retrieves the translation for the provided key from the specified domain (default: 'core').
_e($key, $domain = 'core') – Translate strings and echo them. It outputs the translated text directly.
_m($key) – Translate a string for flash messages. It retrieves the translation from the 'messages' domain.
_n($single_key, $plural_key, $count, $domain = 'core') – Retrieve the singular or plural translation of a string based on the given count. It returns the appropriate form according to the value of $count.
_mn($single_key, $plural_key, $count) – Retrieve the singular or plural translation for flash messages. This function uses the 'messages' domain by default.