2017-02-08 50 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 %}