function view::init_localization

Find and initialize the localization plugin.

2 calls to view::init_localization()
view::export in includes/view.inc
Export a view as PHP code.
view::process_locale_strings in includes/view.inc
Process strings for localization, deletion or export to code.

File

includes/view.inc, line 2162

Class

view
An object to contain all of the data to generate a view.

Code

public function init_localization() {
    // If the translate attribute isn't set, init the localization plugin.
    if (!isset($this->localization_plugin->translate)) {
        $this->localization_plugin = views_get_plugin('localization', views_get_localization_plugin());
        // If the plugin is still not set, turn off all localization by using the
        // views_plugin_localization_none plugin. This plugin has the translate
        // property set to FALSE, signifying localization should not occur.
        if (empty($this->localization_plugin)) {
            $this->localization_plugin = views_get_plugin('localization', 'none');
        }
        // Init the plugin.
        $this->localization_plugin
            ->init($this);
    }
    // Return the value of the translate property. This is set to FALSE if
    // localization is off.
    return $this->localization_plugin->translate;
}