Skip to content

Commit

Permalink
List: Added localization for list selectAll checkbox state (T1248140) (
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkithelegendarypokemonster authored Sep 25, 2024
1 parent 4d32b4f commit 02329f8
Show file tree
Hide file tree
Showing 30 changed files with 91 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ registerDecorator(

const indeterminate = value === undefined;

const checkedText = indeterminate ? 'half checked' : value ? 'checked' : 'not checked';
const label = `${messageLocalization.format('dxList-selectAll')}, ${checkedText}`;
const stateVariableName = indeterminate ? 'indeterminate' : value ? 'checked' : 'notChecked';

const label = `${messageLocalization.format('dxList-selectAll')}, ${messageLocalization.format(`dxList-selectAll-${stateVariableName}`)}`;

this._$selectAll.attr({ 'aria-label': label });
},
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "حذف",
"dxListEditDecorator-more": "المزيد",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "للتحديث اسحب للأسفل...",
"dxScrollView-pulledDownText": "حرر للتحديث ...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Esborrar",
"dxListEditDecorator-more": "Més",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Tireu cap avall per refrescar -se ...",
"dxScrollView-pulledDownText": "Allibereu a refresc ...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Smazat",
"dxListEditDecorator-more": "Více",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Stáhněte dolů pro obnovení...",
"dxScrollView-pulledDownText": "Uvolněte pro obnovení...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Entfernen",
"dxListEditDecorator-more": "Mehr",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Zum Aktualisieren nach unten ziehen",
"dxScrollView-pulledDownText": "Zum Aktualisieren loslassen",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Διαγραφή",
"dxListEditDecorator-more": "Περισσότερα",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Σύρετε απο πάνω προς τα κάτω για ανανέωση...",
"dxScrollView-pulledDownText": "Απελευθερώστε για ανανέωση...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Delete",
"dxListEditDecorator-more": "More",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Pull down to refresh...",
"dxScrollView-pulledDownText": "Release to refresh...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Eliminar",
"dxListEditDecorator-more": "Más",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Desliza hacia abajo para actualizar...",
"dxScrollView-pulledDownText": "Suelta para actualizar...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "حذف",
"dxListEditDecorator-more": "بیشتر",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "برای تازه کردن به پایین بکشید ...",
"dxScrollView-pulledDownText": "انتشار برای تازه کردن ...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Poista",
"dxListEditDecorator-more": "Lisää",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Päivitä vetämällä alas...",
"dxScrollView-pulledDownText": "Päivitä vapauttamalla...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Supprimer",
"dxListEditDecorator-more": "Plus",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Tirez vers le bas pour actualiser...",
"dxScrollView-pulledDownText": "Relacher pour actualiser...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Törlés",
"dxListEditDecorator-more": "Több",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Húzza le a frissítéshez...",
"dxScrollView-pulledDownText": "Engedje el a frissítéshez...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Elimina",
"dxListEditDecorator-more": "Ancora",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Trascina in basso per aggiornare...",
"dxScrollView-pulledDownText": "Rilascia per aggiornare...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "削除",
"dxListEditDecorator-more": "もっと",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "引っ張って更新…",
"dxScrollView-pulledDownText": "指を離して更新…",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Ištrinti",
"dxListEditDecorator-more": "Daugiau",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Patraukite žemyn, kad atnaujintumėte...",
"dxScrollView-pulledDownText": "Atleiskite, kad atnaujintumėte...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/lv.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Dzēst",
"dxListEditDecorator-more": "Vairāk",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Vilkt lejā lai atjaunotu...",
"dxScrollView-pulledDownText": "Atlaist lai atjaunotu...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Slett",
"dxListEditDecorator-more": "Mer",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Dra ned for å oppdatere...",
"dxScrollView-pulledDownText": " Slipp for å oppdatere...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Verwijderen",
"dxListEditDecorator-more": "Meer",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Trek naar beneden om te vernieuwen...",
"dxScrollView-pulledDownText": "Laat los om te vernieuwen...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Usuń",
"dxListEditDecorator-more": "Więcej",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Aby zaktualizować, przeciągnij w dół",
"dxScrollView-pulledDownText": "Aby zaktualizować puść",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Eliminar",
"dxListEditDecorator-more": "Mais",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Puxar para baixo para recarregar...",
"dxScrollView-pulledDownText": "Soltar para recarregar...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Șterge",
"dxListEditDecorator-more": "Mai mult",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Trageți în jos pentru a actualiza...",
"dxScrollView-pulledDownText": "Eliberați pentru a actualiza...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Удалить",
"dxListEditDecorator-more": "Еще",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Потяните, чтобы обновить...",
"dxScrollView-pulledDownText": "Отпустите, чтобы обновить...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Izbriši",
"dxListEditDecorator-more": "Več",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Povlecite navzdol za osvežitev...",
"dxScrollView-pulledDownText": "Spustite za osvežitev...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Radera",
"dxListEditDecorator-more": "Mer",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Dra neråt för att uppdatera...",
"dxScrollView-pulledDownText": "Släpp för att uppdatera...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Sil",
"dxListEditDecorator-more": "Daha",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Yenilemek için aşağıya çekin...",
"dxScrollView-pulledDownText": "Yenilemek için bırakın...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "Xóa",
"dxListEditDecorator-more": "Thêm",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "Kéo xuống để làm tươi...",
"dxScrollView-pulledDownText": "Nhả ra để làm tươi...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "刪除",
"dxListEditDecorator-more": "更多",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "下拉以重新整理...",
"dxScrollView-pulledDownText": "放開以重新整理...",
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme/js/localization/messages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"dxList-listAriaLabel-deletable": "Deletable items",
"dxListEditDecorator-delete": "删除",
"dxListEditDecorator-more": "更多",
"dxList-selectAll-indeterminate": "Half-checked",
"dxList-selectAll-checked": "Checked",
"dxList-selectAll-notChecked": "Not checked",

"dxScrollView-pullingDownText": "下拉以刷新...",
"dxScrollView-pulledDownText": "放开以刷新...",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ QUnit.module('decorators markup', {}, () => {
assert.strictEqual($selectAllCheckBox.attr('aria-label'), localizedSelectAllText, 'selectAll checkbox aria-label should be equal to localized text');

assert.strictEqual($multipleContainer.text(), 'custom-select-all', 'text should be equal to localized text');
assert.strictEqual($multipleContainer.attr('aria-label'), `${localizedSelectAllText}, not checked`, 'unchecked checkbox aria-label should be equal to localized text');
assert.strictEqual($multipleContainer.attr('aria-label'), `${localizedSelectAllText}, Not checked`, 'unchecked checkbox aria-label should be equal to localized text');
});

QUnit.test('list item markup should be correct, reordering decorator', function(assert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4329,7 +4329,7 @@ QUnit.module('Accessibility', () => {

const $selectAll = $(`.${LIST_SELECT_ALL_CLASS}`);

assert.strictEqual($selectAll.attr('aria-label'), 'Select All, not checked');
assert.strictEqual($selectAll.attr('aria-label'), 'Select All, Not checked');
});

QUnit.test('Select all element should have correct aria-label when all items are selected', function(assert) {
Expand All @@ -4344,7 +4344,7 @@ QUnit.module('Accessibility', () => {

const $selectAll = $(`.${LIST_SELECT_ALL_CLASS}`);

assert.strictEqual($selectAll.attr('aria-label'), 'Select All, checked');
assert.strictEqual($selectAll.attr('aria-label'), 'Select All, Checked');
});

QUnit.test('Select all element should have correct aria-label when not all items are selected', function(assert) {
Expand All @@ -4359,7 +4359,7 @@ QUnit.module('Accessibility', () => {

const $selectAll = $(`.${LIST_SELECT_ALL_CLASS}`);

assert.strictEqual($selectAll.attr('aria-label'), 'Select All, half checked');
assert.strictEqual($selectAll.attr('aria-label'), 'Select All, Half-checked');
});

QUnit.test('Select all element should have correct aria-label when selected items change in runtime', function(assert) {
Expand All @@ -4375,15 +4375,15 @@ QUnit.module('Accessibility', () => {

const $selectAll = $(`.${LIST_SELECT_ALL_CLASS}`);

assert.strictEqual($selectAll.attr('aria-label'), 'Select All, half checked');
assert.strictEqual($selectAll.attr('aria-label'), 'Select All, Half-checked');

instance.option({ selectedItems: items });

assert.strictEqual($selectAll.attr('aria-label'), 'Select All, checked');
assert.strictEqual($selectAll.attr('aria-label'), 'Select All, Checked');

instance.option({ selectedItems: [] });

assert.strictEqual($selectAll.attr('aria-label'), 'Select All, not checked');
assert.strictEqual($selectAll.attr('aria-label'), 'Select All, Not checked');
});

QUnit.test('checkbox should have aria-label="Check State" attribute', function(assert) {
Expand Down

0 comments on commit 02329f8

Please sign in to comment.