The hLocale.php helper provides a comprehensive set of functions for managing locale settings in Osclass. It enables you to retrieve locale objects, list available locales, count and iterate over enabled locales, and access various locale-specific formatting options (like currency format, decimal point, and thousands separator). Moreover, it offers utility functions to determine the current user's locale and whether the language direction is right-to-left (RTL), which are essential for creating a multilingual and culturally adaptive website.
osc_locale_field($field, $locale = '') – Gets locale generic field.
osc_locale() – Gets locale object.
osc_get_locales() – Gets list of locales.
osc_priv_count_locales() – Private function to count locales.
osc_goto_first_locale() – Resets the iterator of locales.
osc_count_web_enabled_locales() – Gets the number of enabled locales for the website.
osc_has_web_enabled_locales() – Iterator for enabled locales for the website.
osc_locale_code() – Gets the current locale’s code.
osc_locale_name() – Gets the current locale’s name.
osc_locale_currency_format() – Gets the current locale’s currency format.
osc_locale_dec_point() – Gets the current locale’s decimal point.
osc_locale_thousands_sep() – Gets the current locale’s thousands separator.
osc_locale_num_dec() – Gets the current locale’s number of decimals.
osc_all_enabled_locales_for_admin($indexed_by_pk = false) – Gets the list of enabled locales for admin.
osc_get_current_user_locale() – Gets the current locale object for the user.
osc_current_user_locale() – Gets the actual locale of the current user.
osc_get_current_user_locations_native() – Returns true if the current user's locale should use native location names.
osc_current_user_locale_is_rtl() – Returns true if the current user's locale has right-to-left (RTL) direction.
osc_current_admin_locale() – Gets the actual locale of the admin.