Skip to content

Commit

Permalink
Merge pull request #15046 from snipe/localize_bootstrap_table
Browse files Browse the repository at this point in the history
Added localization for bootstrap-tables
  • Loading branch information
snipe authored Jul 8, 2024
2 parents 3b3a7e2 + 86c0a3e commit cf92dde
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions public/js/dist/bootstrap-table-locale-all.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"/css/webfonts/fa-solid-900.woff2": "/css/webfonts/fa-solid-900.woff2?id=96d16b1bdb177fd796c810b9e706c780",
"/css/webfonts/fa-v4compatibility.ttf": "/css/webfonts/fa-v4compatibility.ttf?id=8994b282f9f3b7a00380bb1e2731a4bf",
"/css/webfonts/fa-v4compatibility.woff2": "/css/webfonts/fa-v4compatibility.woff2?id=111e341dba724e1df946e8d1f406a7bd",
"/js/dist/bootstrap-table-locale-all.min.js": "/js/dist/bootstrap-table-locale-all.min.js?id=7373e7d7017cceca6c32928080cea0fb",
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=5f79123a6750afd34dbf565faec3dda3",
"/js/build/vendor.js": "/js/build/vendor.js?id=e27070bdbc5fce3bfd132b952d641fd6",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=e5918703a22f8992c4c98f1dbbecb8f7",
Expand Down
3 changes: 2 additions & 1 deletion resources/views/partials/bootstrap-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
@push('js')

<script src="{{ url(mix('js/dist/bootstrap-table.js')) }}"></script>
<script src="{{ url(mix('js/dist/bootstrap-table-locale-all.min.js')) }}"></script>

<script nonce="{{ csrf_token() }}">
$(function () {
var locale = '{{ app()->getLocale() }}';
var blockedFields = "searchable,sortable,switchable,title,visible,formatter,class".split(",");
var keyBlocked = function(key) {
Expand Down Expand Up @@ -87,6 +87,7 @@ classes: 'table table-responsive table-no-bordered',
export: 'fa-download',
clearSearch: 'fa-times'
},
locale: '{{ app()->getLocale() }}',
exportOptions: export_options,
exportTypes: ['xlsx', 'excel', 'csv', 'pdf','json', 'xml', 'txt', 'sql', 'doc' ],
onLoadSuccess: function () {
Expand Down
6 changes: 6 additions & 0 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ mix
mix
.copy("./node_modules/@fortawesome/fontawesome-free/webfonts", "./public/css/webfonts")

/**
* Copy BS tables js file
*/
mix
.copy( './node_modules/bootstrap-table/dist/bootstrap-table-locale-all.min.js', 'public/js/dist' )

// Combine main SnipeIT JS files
mix
.js(
Expand Down

0 comments on commit cf92dde

Please sign in to comment.