奇怪的Symfony i18n错误 [英] Strange symfony i18n error

查看:120
本文介绍了奇怪的Symfony i18n错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用symfony 1.4.11.在我的网站上,我的网站"se","en","no"有3种语言.在后端,我仅使用en,并且具有以下设置:

I use symfony 1.4.11. In my site I have 3 languages in my site "se","en","no". In my backend, I use only en, and I have in settings:

全部:

  .settings:
    default_culture: en

但是在某些模块中,当在前端使用"se"语言时,会出现错误:

But in some module, when in frontend I have "se" language, have error :

未找到"se"的数据文件.

在前端,我尝试使用数据库创建i18n;

In frontend I try, make i18n with database;

Stack trace:

stack trace
at ()
in SF_SYMFONY_LIB_DIR/i18n/sfCultureInfo.class.php line 301 ...

      if (is_file($filename) == false)

      {

        throw new sfException(sprintf('Data file for "%s" was not found.', $file));

      }


      if (in_array($filename, $this->dataFiles) == false)
at sfCultureInfo->loadCultureData('se')
in SF_SYMFONY_LIB_DIR/i18n/sfCultureInfo.class.php line 217 ...
at sfCultureInfo->__construct('se')
in SF_SYMFONY_LIB_DIR/i18n/sfCultureInfo.class.php line 136 ...
at sfCultureInfo::getInstance('se')
in SF_SYMFONY_LIB_DIR/i18n/sfDateTimeFormatInfo.class.php line 186 ...
at sfDateTimeFormatInfo::getInstance('se')
in SF_SYMFONY_LIB_DIR/i18n/sfDateFormat.class.php line 100 ...
at sfDateFormat->__construct('se')
in SF_SYMFONY_LIB_DIR/helper/DateHelper.php line 57 ...
at format_date('2011-07-22 01:36:02', 'f')
in SF_ROOT_DIR/cache/backend/dev/modules/autoSfGuardUser/templates/_list_td_tabular.php line 5 ...
at require('/home/dan/WEB/www/europellets-dev.my/cache/backend/dev/modules/autoSfGuardUser/templates/_list_td_tabular.php')
in SF_SYMFONY_LIB_DIR/view/sfPHPView.class.php line 75 ...
at sfPHPView->renderFile('/home/dan/WEB/www/europellets-dev.my/cache/backend/dev/modules/autoSfGuardUser/templates/_list_td_tabular.php')
in SF_SYMFONY_LIB_DIR/view/sfPartialView.class.php line 124 ...
at sfPartialView->render()
in SF_SYMFONY_LIB_DIR/helper/PartialHelper.php line 218 ...
at get_partial('sfGuardUser/list_td_tabular', array('sf_guard_user' => object('sfOutputEscaperIteratorDecorator')))
in SF_SYMFONY_LIB_DIR/helper/PartialHelper.php line 180 ...
at include_partial('sfGuardUser/list_td_tabular', array('sf_guard_user' => object('sfOutputEscaperIteratorDecorator')))
in SF_ROOT_DIR/cache/backend/dev/modules/autoSfGuardUser/templates/_list.php line 31 ...
at require('/home/dan/WEB/www/europellets-dev.my/cache/backend/dev/modules/autoSfGuardUser/templates/_list.php')
in SF_SYMFONY_LIB_DIR/view/sfPHPView.class.php line 75 ...
at sfPHPView->renderFile('/home/dan/WEB/www/europellets-dev.my/cache/backend/dev/modules/autoSfGuardUser/templates/_list.php')
in SF_SYMFONY_LIB_DIR/view/sfPartialView.class.php line 124 ...
at sfPartialView->render()
in SF_SYMFONY_LIB_DIR/helper/PartialHelper.php line 218 ...
at get_partial('sfGuardUser/list', array('pager' => object('sfOutputEscaperIteratorDecorator'), 'sort' => object('sfOutputEscaperArrayDecorator'), 'helper' => object('sfGuardUserGeneratorHelper')))
in SF_SYMFONY_LIB_DIR/helper/PartialHelper.php line 180 ...
at include_partial('sfGuardUser/list', array('pager' => object('sfOutputEscaperIteratorDecorator'), 'sort' => object('sfOutputEscaperArrayDecorator'), 'helper' => object('sfGuardUserGeneratorHelper')))
in SF_ROOT_DIR/cache/backend/dev/modules/autoSfGuardUser/templates/indexSuccess.php line 19 ...
at require('/home/dan/WEB/www/europellets-dev.my/cache/backend/dev/modules/autoSfGuardUser/templates/indexSuccess.php')
in SF_SYMFONY_LIB_DIR/view/sfPHPView.class.php line 75 ...
at sfPHPView->renderFile('/home/dan/WEB/www/europellets-dev.my/cache/backend/dev/modules/autoSfGuardUser/templates/indexSuccess.php')
in SF_SYMFONY_LIB_DIR/view/sfPHPView.class.php line 185 ...
at sfPHPView->render()
in SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 155 ...
at sfExecutionFilter->executeView('sfGuardUser', 'index', 'Success', array('configuration' => object('sfGuardUserGeneratorConfiguration'), 'helper' => object('sfGuardUserGeneratorHelper'), 'filters' => object('sfGuardUserFormFilter'), 'pager' => object('sfDoctrinePager'), 'sort' => array(null, null)))
in SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 116 ...
at sfExecutionFilter->handleView(object('sfFilterChain'), object('sfGuardUserActions'), 'Success')
in SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 47 ...
at sfExecutionFilter->execute(object('sfFilterChain'))
in SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 ...
at sfFilterChain->execute()
in SF_SYMFONY_LIB_DIR/filter/sfRenderingFilter.class.php line 33 ...
at sfRenderingFilter->execute(object('sfFilterChain'))
in SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 53 ...
at sfFilterChain->execute()
in SF_SYMFONY_LIB_DIR/controller/sfController.class.php line 238 ...
at sfController->forward('sfGuardUser', 'index')
in SF_SYMFONY_LIB_DIR/controller/sfFrontWebController.class.php line 48 ...
at sfFrontWebController->dispatch()
in SF_SYMFONY_LIB_DIR/util/sfContext.class.php line 170 ...
at sfContext->dispatch()
in SF_ROOT_DIR/web/backend_dev.php line 13 ...

推荐答案

此错误意味着SF_SYMFONY_LIB_DIR/i18n/data/dir中没有用于"se"文化的ICU数据文件. Symfony支持多种文化,但并非全部.在您的情况下,如果"se"是瑞典语-请使用"sv"代码.

This error means that there is no ICU data file inside SF_SYMFONY_LIB_DIR/i18n/data/ dir for the 'se' culture. Symfony supports many cultures, but not all. In your case, if 'se' is Swedish - use 'sv' code.

sv          sv-SE       Swedish
sv-FI       sv-FI       Swedish (Finland)
sv-SE       sv-SE       Swedish (Sweden)

如果'se'不是瑞典语,并且不在列表中(请参见SF_SYMFONY_LIB_DIR/i18n/data/dir)-使用内部令牌代替模式(例如format_date($date, 'f') -> format_date($date, 'd MMMM YYYY, hh:mm'))

If 'se' is not Swedish and it is not in out of the box list (see SF_SYMFONY_LIB_DIR/i18n/data/ dir) - use internal tokens instead of pattern (e.g. format_date($date, 'f') -> format_date($date, 'd MMMM YYYY, hh:mm')) formatDateHowTo

这篇关于奇怪的Symfony i18n错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆