Property | Type | Description | |
---|---|---|---|
$_search_dapter | FluentSearchAdapter | Cached search adapter | |
$force_is_frontend | boolean | If set, "is_frontend" can be forced to return a value | |
$last_set_locale | Indicates the last locale set via Cookies, in order to prevent excessive Cookie setting |
Method | Description | |
---|---|---|
alias ( string $locale ) : string | Determine the alias to use for a specific locale | |
any_match ( string $value, array $patterns ) : boolean | Helper function to check if the value given is present in any of the patterns. | |
current_locale ( boolean $persist = true ) : string | Gets the current locale | |
db_field_for_locale ( string $field, string $locale ) | Determine the DB field name to use for the given base field | |
default_locale ( mixed $domain = null ) : string | Retrieves the default locale | |
detect_browser_locale ( mixed $domain = null ) : string | Determines the locale best matching the given list of browser locales | |
disable_default_prefix ( ) : boolean | Check if default locale should have prefix disabled | |
domain_for_locale ( string $locale ) | Determine the home domain for this locale | |
domains ( ) : array | Retrieves any configured domains, assuming the site is running in domain mode. | |
get_persist_locale ( string $key = null ) : string | null | Gets the locale currently set within either the session or cookie. | |
get_request_locale ( ) : string | Gets the locale requested directly in the request, either via route, post, or query parameters | |
get_template_global_variables ( ) : array | ||
init ( ) | Initialise routes | |
install_locale ( boolean $persist = true ) | Installs the current locale into i18n | |
isFieldModified ( DataObject $object, FormField $field, string | null $locale = null ) : boolean | Given a field on an object and optionally a locale, compare its locale value against the default locale value to determine if the value is changed at the given locale. | |
is_domain_mode ( ) : boolean | Determine if the website is in domain segmentation mode | |
is_frontend ( boolean $ignoreController = false ) : boolean | Determines behaviour of locale filter in this request, by detecting whether to present an admin view of the site, or a frontend view. | |
is_locale ( string $locale ) : boolean | Determine if a locale code is within the range of configured locales | |
locale_baseurl ( string $locale = null ) : string | Determine the baseurl within a specified $locale. | |
locale_names ( ) : array | Retrieves the list of locale names as an associative array | |
locale_native_name ( string $locale ) : string | Fetch a native language string from the i18n class via a passed locale in the format "XX_xx". In the event a match cannot be found in any framework resource, an empty string is returned. | |
locales ( mixed $domain = null ) : array | Retrieves the list of locales | |
regenerate_routes ( ) | Forces regeneration of all locale routes | |
search_adapter ( ) : FluentSearchAdapter | Retrieves a search adapter for the current database adapter | |
set_force_is_frontend ( boolean $force = true ) | Sets whether to force "is_frontend" to return true or false. This can be used for situations where the frontend controllers are not involved, e.g. API modules, unit testing or retrieving data programmatically. | |
set_persist_locale ( string $locale, string $key = null ) | Specify the locale to persist between sessions, or to use for the locale outside of locale-routed pages (such as in unit tests, custom controllers, etc). | |
with_locale ( string $locale, callable $callback ) : mixed | Executes a callback with a locale to temporarily emulate. |
public static any_match ( string $value, array $patterns ) : boolean | ||
$value | string | A string value to check against, potentially with parameters (E.g. 'Varchar(1023)') |
$patterns | array | A list of strings, some of which may be regular expressions |
return | boolean | True if this $value is present in any of the $patterns |
public static current_locale ( boolean $persist = true ) : string | ||
$persist | boolean | Attempt to persist any detected locale within session / cookies |
return | string | i18n locale code |
public static db_field_for_locale ( string $field, string $locale ) | ||
$field | string | DB field name |
$locale | string | Locale to use |
public static default_locale ( mixed $domain = null ) : string | ||
$domain | mixed | Domain to determine the default locale for. If null, the global default will be returned. If true, then the current domain will be used. |
return | string |
public static detect_browser_locale ( mixed $domain = null ) : string | ||
$domain | mixed | Domain to determine the locales for. If null, the global list be returned. If true, then the current domain will be used. |
return | string | The matching locale, or null if none could be determined |
public static disable_default_prefix ( ) : boolean | ||
return | boolean |
public static domain_for_locale ( string $locale ) | ||
$locale | string |
public static get_request_locale ( ) : string | ||
return | string | The locale, if available |
public static get_template_global_variables ( ) : array | ||
return | array |
public static install_locale ( boolean $persist = true ) | ||
$persist | boolean | Attempt to persist any detected locale within session / cookies |
public static is_domain_mode ( ) : boolean | ||
return | boolean |
public static is_frontend ( boolean $ignoreController = false ) : boolean | ||
$ignoreController | boolean | Flag to indicate whether the current controller should be ignored, and detection should be performed by inspecting the URL. Used for testing. Defaults to false. |
return | boolean | Flag indicating if the translation should act on the frontend |
public static locale_baseurl ( string $locale = null ) : string | ||
$locale | string | Locale, or null to use current locale |
return | string |
public static locale_names ( ) : array | ||
return | array | List of locale names mapped by locale code |
public static locale_native_name ( string $locale ) : string | ||
$locale | string | e.g. "pt_BR" |
return | string | The native language string for that locale e.g. "português (Brazil)" |
public static regenerate_routes ( ) |
public static search_adapter ( ) : FluentSearchAdapter | ||
return | FluentSearchAdapter |
public static set_force_is_frontend ( boolean $force = true ) | ||
$force | boolean |
public static set_persist_locale ( string $locale, string $key = null ) | ||
$locale | string | Locale to assign |
$key | string | ID to set the locale against. Will automatically detect if omitted. Either Fluent:::config()->persist_id or Fluent::::config()->persist_id_cms. |
protected static FluentSearchAdapter $_search_dapter | ||
return | FluentSearchAdapter |
protected static bool $force_is_frontend | ||
return | boolean |