本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Translation\Translator::loadCatalogue方法的典型用法代码示例。如果您正苦于以下问题:PHP Translator::loadCatalogue方法的具体用法?PHP Translator::loadCatalogue怎么用?PHP Translator::loadCatalogue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Translation\Translator
的用法示例。
在下文中一共展示了Translator::loadCatalogue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadCatalogue
/**
* {@inheritdoc}
*/
protected function loadCatalogue($locale)
{
if ($this->options['debug'] === true) {
$this->options['cache_dir'] = null;
// disable caching for debug
}
return parent::loadCatalogue($locale);
}
示例2: loadCatalogue
/**
* {@inheritdoc}
*/
protected function loadCatalogue($locale)
{
if ($locale != 'en_US') {
// Always force en_US so that it's available for fallback
$this->addResource('mautic', null, 'en_US', 'messages');
}
$this->addResource('mautic', null, $locale, 'messages');
parent::loadCatalogue($locale);
}
示例3: loadCatalogue
protected function loadCatalogue($locale)
{
// Schauen, ob die Cache-Datei älter als wfd_meta.last_touched ist
foreach ($this->getCacheFiles($locale) as $cacheFile) {
if (filemtime($cacheFile) < $this->metaQuery->getLastTouched()) {
@unlink($cacheFile);
}
}
parent::loadCatalogue($locale);
}
示例4: loadCatalogue
/**
* {@inheritdoc}
*/
protected function loadCatalogue($locale)
{
$this->ensureDatabaseLoaderAdded($locale);
// check if any dynamic resource is changed and update translation catalogue if needed
if (!empty($this->dynamicResources) && isset($this->dynamicResources[$locale]) && !empty($this->dynamicResources[$locale])) {
$catalogueFile = $this->options['cache_dir'] . '/catalogue.' . $locale . '.' . sha1(serialize($this->getFallbackLocales())) . '.php';
if (is_file($catalogueFile)) {
$time = filemtime($catalogueFile);
/** @var DynamicResourceInterface $dynamicResource */
foreach ($this->dynamicResources[$locale] as $dynamicResource) {
if (!$dynamicResource->isFresh($time)) {
// remove translation catalogue to allow parent class to rebuild it
unlink($catalogueFile);
break;
}
}
}
}
parent::loadCatalogue($locale);
}
示例5: loadCatalogue
/**
* {@inheritdoc}
*/
protected function loadCatalogue($locale)
{
$this->initializeDynamicResources($locale);
parent::loadCatalogue($locale);
}