Skip to content

Commit 357a4b8

Browse files
committed
minor #2279 [Autocomplete] Translate "Add ..." text with remote data setup (Jonas De Keukelaere)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Autocomplete] Translate "Add ..." text with remote data setup | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT In symfony/ux#2108 the "Add..." translation has been added. But this only worked for non remote data setups. This PR makes it work for remote data setup too. Also add translation for Dutch. Commits ------- d2b26d36 [Autocomplete] Translate "Add ..." text with remote data setup
2 parents 17a568a + 4db7f2c commit 357a4b8

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

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

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,

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,

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)