![]() |
GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
Public Member Functions | |
can_install_languages () | |
Checks of user has permissions to install languages. More... | |
get_T15s_updater ( $text_domain) | |
Returns TranslationsPress updater instance. More... | |
init () | |
Initializes Translations framework. More... | |
install ( $text_domain, $new_language) | |
Downloads and installs translations from TranslationsPress. More... | |
is_en_locale ( $locale='') | |
Checks whether the current locale is set to English language. More... | |
load_all_translations ( $text_domain, $language='') | |
Loads and sets frontend and backend translations. More... | |
load_backend_translations ( $text_domain, $language='') | |
Loads and sets backend translations. More... | |
load_frontend_translations ( $text_domain, $language='', $frontend_text_domain='') | |
Loads and sets frontend translations. More... | |
on_plugin_activation ( $plugin_file) | |
Installs or updates translations for all plugins when a plugin is activated. More... | |
on_plugin_deactivation ( $plugin_file) | |
Deletes translations when the plugin is deactivated. More... | |
on_site_language_change ( $from_language, $to_language) | |
Installs or updates translations for all plugins when the site's language setting is changed. More... | |
Static Public Member Functions | |
static | get_instance () |
Returns class instance. More... | |
static | get_translation_filename ( $text_domain, $language, $extension='mo') |
Returns the translation filename for a given language. More... | |
Data Fields | |
const | ID = 'gk-translations' |
const | WP_LANG_DIR = WP_LANG_DIR . '/plugins' |
Private Attributes | |
$_logger | |
$_text_domains = [] | |
Static Private Attributes | |
static | $_instance |
Definition at line 15 of file Translations/Framework.php.
can_install_languages | ( | ) |
Checks of user has permissions to install languages.
gk/foundation/translations/permissions/can_install_languages
Sets permission to install languages.bool | $can_install_languages | Default: 'install_languages' capability. |
Definition at line 120 of file Translations/Framework.php.
Referenced by Framework\install(), Framework\on_plugin_activation(), Framework\on_plugin_deactivation(), and Framework\on_site_language_change().
|
static |
Returns class instance.
Definition at line 52 of file Translations/Framework.php.
get_T15s_updater | ( | $text_domain | ) |
Returns TranslationsPress updater instance.
string | $text_domain | Text domain. |
Definition at line 69 of file Translations/Framework.php.
References TranslationsPress_Updater\get_instance().
Referenced by Framework\install().
|
static |
Returns the translation filename for a given language.
string | $text_domain | Text domain. |
string | $language | Translation language (e.g. 'en_EN'). |
string | $extension | (optional) File extension. Default is 'mo'. |
Definition at line 281 of file Translations/Framework.php.
Referenced by Framework\load_backend_translations(), and Framework\load_frontend_translations().
init | ( | ) |
Initializes Translations framework.
gk/foundation/translations/initialized
Fires when the class has finished initializing.$this |
Definition at line 80 of file Translations/Framework.php.
install | ( | $text_domain, | |
$new_language | |||
) |
Downloads and installs translations from TranslationsPress.
string | $text_domain | Text domain. |
string | $new_language | The new site language, only set if user is updating their language settings. |
Definition at line 141 of file Translations/Framework.php.
References Framework\can_install_languages(), Framework\get_T15s_updater(), and Framework\load_backend_translations().
Referenced by Framework\on_plugin_activation(), and Framework\on_site_language_change().
is_en_locale | ( | $locale = '' | ) |
Checks whether the current locale is set to English language.
string | $locale | (optional) Locale to check. Default is site locale. |
Definition at line 372 of file Translations/Framework.php.
Referenced by Framework\load_frontend_translations(), Framework\on_plugin_activation(), and Framework\on_plugin_deactivation().
load_all_translations | ( | $text_domain, | |
$language = '' |
|||
) |
Loads and sets frontend and backend translations.
string | $text_domain | Text domain. |
string | $language | (optional) Language to load. Default is site locale. |
Definition at line 178 of file Translations/Framework.php.
References Framework\load_backend_translations(), and Framework\load_frontend_translations().
load_backend_translations | ( | $text_domain, | |
$language = '' |
|||
) |
Loads and sets backend translations.
string | $text_domain | Text domain. |
string | $language | (optional) Language to load. Default is site locale. |
Definition at line 193 of file Translations/Framework.php.
References Framework\get_translation_filename().
Referenced by Framework\install(), and Framework\load_all_translations().
load_frontend_translations | ( | $text_domain, | |
$language = '' , |
|||
$frontend_text_domain = '' |
|||
) |
Loads and sets frontend translations.
string | $text_domain | Text domain. |
string | $language | (optional) Language to load. Default is site locale. |
string | $frontend_text_domain | (optional) Frontend text domain if different from the backend text domain (e.g., plugin uses 'foo', but JS uses 'bar' for the same translations). |
Definition at line 226 of file Translations/Framework.php.
References Framework\get_translation_filename(), and Framework\is_en_locale().
Referenced by Framework\load_all_translations().
on_plugin_activation | ( | $plugin_file | ) |
Installs or updates translations for all plugins when a plugin is activated.
string | $plugin_file | Plugin file. |
Definition at line 316 of file Translations/Framework.php.
References Framework\can_install_languages(), Framework\install(), and Framework\is_en_locale().
on_plugin_deactivation | ( | $plugin_file | ) |
Deletes translations when the plugin is deactivated.
string | $plugin_file | Plugin file. |
Definition at line 339 of file Translations/Framework.php.
References Framework\can_install_languages(), and Framework\is_en_locale().
on_site_language_change | ( | $from_language, | |
$to_language | |||
) |
Installs or updates translations for all plugins when the site's language setting is changed.
string | $from_language | The language before the user changed their language setting. |
string | $to_language | The new language after the user changed their language setting. |
Definition at line 297 of file Translations/Framework.php.
References Framework\can_install_languages(), and Framework\install().
|
staticprivate |
Definition at line 27 of file Translations/Framework.php.
|
private |
Definition at line 36 of file Translations/Framework.php.
|
private |
Definition at line 43 of file Translations/Framework.php.
const ID = 'gk-translations' |
Definition at line 16 of file Translations/Framework.php.
const WP_LANG_DIR = WP_LANG_DIR . '/plugins' |
Definition at line 18 of file Translations/Framework.php.