Backend\Modules\Locale\Engine\Model::buildCache PHP Method

buildCache() public static method

Build the language files
public static buildCache ( string $language, string $application )
$language string The language to build the locale-file for.
$application string The application to build the locale-file for.
    public static function buildCache($language, $application)
    {
        $cacheBuilder = new CacheBuilder(BackendModel::get('database'));
        $cacheBuilder->buildCache($language, $application);
    }

Usage Example

Example #1
0
 /**
  * Create locale cache files
  *
  * @param InstallationData $data
  */
 protected function createLocaleFiles(InstallationData $data)
 {
     // all available languages
     $languages = array_unique(array_merge($data->getLanguages(), $data->getInterfaceLanguages()));
     // loop all the languages
     foreach ($languages as $language) {
         // get applications
         $applications = $this->container->get('database')->getColumn('SELECT DISTINCT application
              FROM locale
              WHERE language = ?', array((string) $language));
         // loop applications
         foreach ((array) $applications as $application) {
             // build application locale cache
             BackendLocaleModel::buildCache($language, $application);
         }
     }
 }
All Usage Examples Of Backend\Modules\Locale\Engine\Model::buildCache