Skip to content

Commit d2b26d3

Browse files
Jonas De Keukelaerekbond
authored andcommitted
[Autocomplete] Translate "Add ..." text with remote data setup
1 parent c9bf5ee commit d2b26d3

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/Autocomplete/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 2.21.0
4+
5+
- Translate the `option_create` option from TomSelect with remote data setup #2279
6+
- Add one missing Dutch translation #2279
7+
38
## 2.20.0
49

510
- Translate the `option_create` option from TomSelect #2108

src/Autocomplete/assets/dist/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ _default_1_instances = new WeakSet(), _default_1_getCommonConfig = function _def
318318
return `<div class="no-results">${this.noResultsFoundTextValue}</div>`;
319319
},
320320
option_create: (data, escapeData) => {
321-
return `<div class="create">${this.createOptionTextValue} <strong>${escapeData(data.input)}</strong>&hellip;</div>`;
321+
return `<div class="create">${this.createOptionTextValue.replace('%placeholder%', `<strong>${escapeData(data.input)}</strong>`)}</div>`;
322322
},
323323
},
324324
preload: this.preload,

src/Autocomplete/assets/src/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export default class extends Controller {
253253
return `<div class="no-results">${this.noResultsFoundTextValue}</div>`;
254254
},
255255
option_create: (data: TomOption, escapeData: typeof escape_html): string => {
256-
return `<div class="create">${this.createOptionTextValue} <strong>${escapeData(data.input)}</strong>&hellip;</div>`;
256+
return `<div class="create">${this.createOptionTextValue.replace('%placeholder%', `<strong>${escapeData(data.input)}</strong>`)}</div>`;
257257
},
258258
},
259259
preload: this.preload,

src/Autocomplete/translations/AutocompleteBundle.nl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
'Loading more results...' => 'Meer resultaten aan het laden...',
1414
'No results found' => 'Geen resultaten gevonden…',
1515
'No more results' => 'Niet meer resultaten gevonden…',
16-
// 'Add %placeholder%...' => 'Add %placeholder%...',
16+
'Add %placeholder%...' => 'Voeg %placeholder% toe...',
1717
];

0 commit comments

Comments
 (0)