更改Bootfaces DataTable的区域设置和语言 [英] Change the Locale and Language of the Bootfaces DataTable
问题描述
我想更改BootsFaces元素的语言b:dataTable。
(例如:entries => entradas,next => siguiente) p>
有人知道如何做吗?
正如Bonifacio所说, BootsFaces 0.8.x的DataTable小部件还处于起步阶段。目前,我们正在努力为您带来所需的所有功能 - 包括国际化。也许你想观看我们的错误跟踪器的讨论( https://github.com/TheCoder4eu / BootsFaces-OSP / issues / 301 )。
顺便说一下,通过标准JSF 2.x代码替换BootsFaces dataTable,令人惊讶的是,几行JavaScript:
< h:dataTable value ={{carPool.carPool}}var =car id =carPoolstyleClass =table table-striped table-bordered
style =width:100%>
< h:column>
< f:facet name =header>
< h:outputText value =品牌/>
< / f:facet>
< h:outputText value =#{car.brand}/>
< / h:column>
< h:column>
< f:facet name =header>
< h:outputText value =Type/>
< / f:facet>
< h:inputText value =#{car.type}/>
< / h:column>
< / h:dataTable>
< script>
$(document).ready(function(){
$('#carPool')。DataTable({
language:{
url:// cdn.datatables.net/plug-ins/1.10.10/i18n/Spanish.json
}
});
});
< / script>
我在大多数 http://www.bootsfaces.net/forms/DataTable.jsf 。您可以在这里找到源代码:纯HTML 和 JSF 2.x 。作为第三种替代方法,您可以使用ui:repeat构建HTML代码。
I want to change the language of the elements of the BootsFaces b:dataTable.
(ex: entries => entradas, next=>siguiente),
Does anyone know how to do this?
As Bonifacio mentioned, the DataTable widget of BootsFaces 0.8.x is still in its infancy. Currently, we're working hard to bring you all the features you need - internationalization included. Maybe you want to watch the discussion on our bug tracker (https://github.com/TheCoder4eu/BootsFaces-OSP/issues/301).
By the way, it's surprisingly simple to replace the BootsFaces dataTable by standard JSF 2.x code and a few lines of JavaScript:
<h:dataTable value="{{carPool.carPool}}" var="car" id="carPool" styleClass="table table-striped table-bordered"
style="width:100%">
<h:column>
<f:facet name="header">
<h:outputText value="Brand" />
</f:facet>
<h:outputText value="#{car.brand}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Type" />
</f:facet>
<h:inputText value="#{car.type}" />
</h:column>
</h:dataTable>
<script>
$(document).ready(function() {
$('#carPool').DataTable({
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.10/i18n/Spanish.json"
}
});
} );
</script>
I did this in the most examples of http://www.bootsfaces.net/forms/DataTable.jsf. You'll find the source code here: pure HTML and JSF 2.x. As a third alternative, you can construct the HTML code using ui:repeat.
这篇关于更改Bootfaces DataTable的区域设置和语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!