2017-02-08 54 views
1

我在symfony项目安装KNP分页程序包和我得到这个警告,在我看来 error message error output 安装该软件包 后,我有这样的错误消息,这是由于这捆绑或我有东西导致这个消息如何解决翻译错误消息KNP分页程序的symfony 3

+0

您是否使用最新的KnpPaginationBundle?我在22天前发现了一个新的提交,其中包括您的语言环境(fr)的翻译。无论您在那里看到“KnpPaginatorBundle.fr.xliff”文件,请检查您的“/ path/to/project/vendor/knplabs/knp-paginator-bundle/Resources/translations”。 https://github.com/KnpLabs/KnpPaginatorBundle/tree/master/Resources/translations –

+0

我昨天安装了这个软件包,我没有在我的供应商中找到这个文件,所以我该怎么办? –

回答

0

我找到了这个问题的解决方案,我打开了我的分页/路径/到/项目/供应商/ knplabs/knp-paginator-bundle视图/资源/ views/pagination和我改变了法文的英文信息,它工作正常

{% if pageCount > 1 %} 
<ul class="pagination"> 
    {% if previous is defined %} 
      <li class="arrow"> 
       <a href="{{ path(route, query|merge({(pageParameterName): previous})) }}">&laquo; {{ 'Précédant' }}</a> 
      </li> 
    {% else %} 
     <li class="arrow unavailable"> 
      <a> 
       &laquo; {{ 'Précédant' }} 
      </a> 
     </li> 
    {% endif %} 

    {% if startPage > 1 %} 
     <li> 
      <a href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a> 
     </li> 
     {% if startPage == 3 %} 
      <li> 
       <a href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a> 
      </li> 
     {% elseif startPage != 2 %} 
      <li class="unavailable"> 
       <a>&hellip;</a> 
      </li> 
     {% endif %} 
    {% endif %} 

    {% for page in pagesInRange %} 
     {% if page != current %} 
      <li> 
       <a href="{{ path(route, query|merge({(pageParameterName): page})) }}"> 
        {{ page }} 
       </a> 
      </li> 
     {% else %} 
      <li class="current"> 
       <a>{{ page }}</a> 
      </li> 
     {% endif %} 

    {% endfor %} 

    {% if pageCount > endPage %} 
     {% if pageCount > (endPage + 1) %} 
      {% if pageCount > (endPage + 2) %} 
       <li class="unavailable"> 
        <a>&hellip;</a> 
       </li> 
      {% else %} 
       <li> 
        <a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}"> 
         {{ pageCount -1 }} 
        </a> 
       </li> 
      {% endif %} 
     {% endif %} 
     <li> 
      <a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a> 
     </li> 
    {% endif %} 

    {% if next is defined %} 
     <li class="arrow"> 
      <a href="{{ path(route, query|merge({(pageParameterName): next})) }}"> 
       {{ 'Suivant'}} &nbsp;&raquo; 
      </a> 
     </li> 
    {% else %} 
     <li class="arrow unavailable"> 
      <a> 
       {{ 'Suivant'}} &nbsp;&raquo; 
      </a> 
     </li> 
    {% endif %} 
</ul> 
    {% endif %}