summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-11-05 18:49:11 +0000
committerGreg Roach <fisharebest@webtrees.net>2018-11-05 18:49:11 +0000
commit71d313c576f7a846533c6ef1a010063a6c9ecafc (patch)
treec1a780e0602001450757065c1b14f7c740a6ef26 /resources
parent73f4f5534371cf58efa536a71eda9ca708172a70 (diff)
downloadwebtrees-71d313c576f7a846533c6ef1a010063a6c9ecafc.tar.gz
webtrees-71d313c576f7a846533c6ef1a010063a6c9ecafc.tar.bz2
webtrees-71d313c576f7a846533c6ef1a010063a6c9ecafc.zip
Fix: #2019 - datatables text not translated
Diffstat (limited to 'resources')
-rw-r--r--resources/views/admin/fix-level-0-media.phtml7
-rw-r--r--resources/views/admin/webtrees1-thumbnails.phtml9
-rw-r--r--resources/views/lists/datatables-attributes.phtml27
-rw-r--r--resources/views/lists/notes-table.phtml2
-rw-r--r--resources/views/lists/repositories-table.phtml2
-rw-r--r--resources/views/lists/sources-table.phtml2
6 files changed, 44 insertions, 5 deletions
diff --git a/resources/views/admin/fix-level-0-media.phtml b/resources/views/admin/fix-level-0-media.phtml
index 1de0566893..9869aa2305 100644
--- a/resources/views/admin/fix-level-0-media.phtml
+++ b/resources/views/admin/fix-level-0-media.phtml
@@ -9,7 +9,12 @@
<?= I18N::translate('If a media object is linked to an individual, when it should be linked to a fact or event, then you can move it to the correct location.') ?>
</p>
-<table class="table table-bordered table-sm table-hover datatables wt-fix-table" data-ajax="<?= e(json_encode(['url' => route('admin-fix-level-0-media-data')])) ?>" data-server-side="true" data-state-save="true">
+<table
+ class="table table-bordered table-sm table-hover datatables wt-fix-table"
+ <?= view('lists/datatables-attributes') ?>
+ data-ajax="<?= e(json_encode(['url' => route('admin-fix-level-0-media-data')])) ?>"
+ data-server-side="true"
+>
<caption class="sr-only">
<?= I18N::translate('Media objects') ?>
</caption>
diff --git a/resources/views/admin/webtrees1-thumbnails.phtml b/resources/views/admin/webtrees1-thumbnails.phtml
index 3a88838c3a..391e4bf513 100644
--- a/resources/views/admin/webtrees1-thumbnails.phtml
+++ b/resources/views/admin/webtrees1-thumbnails.phtml
@@ -13,7 +13,14 @@
<?= I18N::translate('If the thumbnail image is the same as the original image, it is no longer needed and you should delete it. If it is a custom image, you should add it to the media object.') ?>
</p>
-<table class="table table-bordered table-sm table-hover datatables wt-fix-table" data-ajax="<?= e(json_encode(['url' => route('admin-webtrees1-thumbs-data')])) ?>" data-server-side="true" data-state-save="true" data-sort="false" data-auto-width="false" data-save-state="true">
+<table
+ class="table table-bordered table-sm table-hover datatables wt-fix-table"
+ <?= view('lists/datatables-attributes') ?>
+ data-ajax="<?= e(json_encode(['url' => route('admin-webtrees1-thumbs-data')])) ?>"
+ data-server-side="true"
+ data-sort="false"
+ data-auto-width="false"
+>
<caption class="sr-only">
<?= I18N::translate('Media objects') ?>
</caption>
diff --git a/resources/views/lists/datatables-attributes.phtml b/resources/views/lists/datatables-attributes.phtml
new file mode 100644
index 0000000000..8901f4f10c
--- /dev/null
+++ b/resources/views/lists/datatables-attributes.phtml
@@ -0,0 +1,27 @@
+<?php use Fisharebest\Webtrees\I18N; ?>
+
+data-state-save="true"
+data-language="<?= e(json_encode([
+ 'paginate' => [
+ /* I18N: A button label, first page */
+ 'first' => I18N::translate('first'),
+ /* I18N: A button label, last page */
+ 'last' => I18N::translate('last'),
+ /* I18N: A button label, next page */
+ 'next' => I18N::translate('next'),
+ /* I18N: A button label, previous page */
+ 'previous' => I18N::translate('previous'),
+ ],
+ 'emptyTable' => I18N::translate('No records to display'),
+ /* I18N: %s are placeholders for numbers */
+ 'info' => I18N::translate('Showing %1$s to %2$s of %3$s', '_START_', '_END_', '_TOTAL_'),
+ 'infoEmpty' => I18N::translate('Showing %1$s to %2$s of %3$s', I18N::number(0), I18N::number(0), I18N::number(0)),
+ /* I18N: %s is a number */
+ 'infoFiltered' => I18N::translate('(filtered from %s total entries)', '_MAX_'),
+ /* I18N: %s is a number of records per page */
+ 'lengthMenu' => I18N::translate('Display %s', '_MENU_'),
+ 'loadingRecords' => I18N::translate('Loading…'),
+ 'processing' => I18N::translate('Calculating…'),
+ 'search' => I18N::translate('Filter'),
+ 'zeroRecords' => I18N::translate('No records to display'),
+])) ?>"
diff --git a/resources/views/lists/notes-table.phtml b/resources/views/lists/notes-table.phtml
index 80573071fb..b075831034 100644
--- a/resources/views/lists/notes-table.phtml
+++ b/resources/views/lists/notes-table.phtml
@@ -21,6 +21,7 @@ $count_sources = Database::prepare(
<table
class="table table-bordered table-sm wt-table-note datatables"
+ <?= view('lists/datatables-attributes') ?>
data-columns="<?= e(json_encode([
null,
['visible' => array_sum($count_individuals) > 0],
@@ -29,7 +30,6 @@ $count_sources = Database::prepare(
['visible' => array_sum($count_sources) > 0],
['visible' => (bool) $tree->getPreference('SHOW_LAST_CHANGE'), 'searchable' => false],
])) ?>"
- data-state-save="true"
>
<caption class="sr-only">
<?= $caption ?? I18N::translate('Sources') ?>
diff --git a/resources/views/lists/repositories-table.phtml b/resources/views/lists/repositories-table.phtml
index 4021c24d5c..d721378911 100644
--- a/resources/views/lists/repositories-table.phtml
+++ b/resources/views/lists/repositories-table.phtml
@@ -12,12 +12,12 @@ $count_sources = Database::prepare(
<table
class="table table-bordered table-sm wt-table-source datatables d-none"
+ <?= view('lists/datatables-attributes') ?>
data-columns="<?= e(json_encode([
null,
['visible' => array_sum($count_sources) > 0],
['visible' => (bool) $tree->getPreference('SHOW_LAST_CHANGE'), 'searchable' => false],
])) ?>"
- data-state-save="true"
>
<caption class="sr-only">
<?= $caption ?? I18N::translate('Repositories') ?>
diff --git a/resources/views/lists/sources-table.phtml b/resources/views/lists/sources-table.phtml
index 874593eef7..0715a735ae 100644
--- a/resources/views/lists/sources-table.phtml
+++ b/resources/views/lists/sources-table.phtml
@@ -21,6 +21,7 @@ $count_notes = Database::prepare(
<table
class="table table-bordered table-sm wt-table-source datatables d-none"
+ <?= view('lists/datatables-attributes') ?>
data-columns="<?= e(json_encode([
null,
null,
@@ -30,7 +31,6 @@ $count_notes = Database::prepare(
['visible' => array_sum($count_notes) > 0],
['visible' => (bool) $tree->getPreference('SHOW_LAST_CHANGE'), 'searchable' => false],
])) ?>"
- data-state-save="true"
>
<caption class="sr-only">
<?= $caption ?? I18N::translate('Sources') ?>