本文整理汇总了PHP中Library\Application::getTranslationConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::getTranslationConfig方法的具体用法?PHP Application::getTranslationConfig怎么用?PHP Application::getTranslationConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library\Application
的用法示例。
在下文中一共展示了Application::getTranslationConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfig
/**
* @internal
*/
public function getConfig()
{
$config = array('controller_plugins' => array('invokables' => array('_' => 'Library\\Mvc\\Controller\\Plugin\\TranslationHelper', 'RedirectToRoute' => 'Library\\Mvc\\Controller\\Plugin\\RedirectToRoute', 'UrlFromRoute' => 'Library\\Mvc\\Controller\\Plugin\\UrlFromRoute')), 'service_manager' => array('factories' => array('\\Library\\Logger' => 'Library\\Log\\LoggerServiceFactory'), 'invokables' => array('Library\\ArchiveManager' => 'Library\\ArchiveManager', 'Library\\Now' => 'DateTime', 'Library\\Random' => 'Library\\Random'), 'shared' => array('Library\\Now' => false)), 'translator_plugins' => array('invokables' => array('Po' => 'Library\\I18n\\Translator\\Loader\\Po')), 'view_helpers' => array('factories' => array('formYesNo' => 'Library\\View\\Helper\\Service\\FormYesNoFactory', 'htmlTag' => 'Library\\View\\Helper\\Service\\HtmlTagFactory'), 'invokables' => array('formSelectSimple' => 'Library\\View\\Helper\\FormSelectSimple', 'formSelectUntranslated' => 'Library\\View\\Helper\\FormSelectUntranslated')));
$config += Application::getTranslationConfig(static::getPath('data/i18n'));
if (\Locale::getPrimaryLanguage(\Locale::getDefault()) != 'en') {
$zfTranslations = @($appConfig = Application::getConfig()['paths']['Zend translations']);
if (is_dir($zfTranslations)) {
$locale = \Locale::getDefault();
$translationFile = "{$zfTranslations}/{$locale}/Zend_Validate.php";
if (!is_file($translationFile)) {
$locale = \Locale::getPrimaryLanguage($locale);
$translationFile = "{$zfTranslations}/{$locale}/Zend_Validate.php";
if (!is_file($translationFile)) {
$translationFile = null;
}
}
if ($translationFile) {
$config['translator']['translation_files'][] = array('type' => 'phparray', 'filename' => $translationFile, 'text_domain' => 'Zend');
}
}
}
return $config;
}
示例2: getConfig
/**
* @internal
*/
public function getConfig()
{
$config = (require __DIR__ . '/../module.config.php');
$config += \Library\Application::getTranslationConfig(static::getPath('data/i18n'));
return $config;
}
示例3: testGetTranslationConfigNoFile
public function testGetTranslationConfigNoFile()
{
$locale = \Locale::getDefault();
\Locale::setDefault('de_DE');
$basePath = vfsStream::setup('root');
$this->assertEquals(array(), Application::getTranslationConfig($basePath->url()));
\Locale::setDefault($locale);
}