Skip to content

Messages ​

Every visible or announced string comes from a Messages object. The grid picks a pack by locale (locales starting with tr get Turkish, all others English) and merges overrides over it:

text
language pack  →  configure({ messages })  →  grid option messages

Keys you leave out, or set to undefined, keep the value from the layer below.

js
import { configure, Datagrid } from "@akinozgen17/datagrids";

configure({ messages: { empty: "Nothing here yet" } });            // every grid created afterwards
new Datagrid("#agents", {
  label: "Agents",
  messages: { found: (n) => `${n} agents found`, records: "agents" }, // this grid only
  columns,
});

Function keys keep their signature. Numbers arrive already formatted for the grid's locale ("1,234" / "1.234"), so a function only places them. Both packs are exported as en and tr for starting a new language; see Static API and Localization.

Toolbar and states ​

KeyEnglishTurkish
searchSearch…Ara…
searchLabelSearchAra
clearClearTemizle
loadingLoading…Yükleniyor…
emptyNo recordsKayıt yok
emptyTextThere is nothing to show yet.Henüz gösterilecek kayıt yok.
noMatchNo matching recordsEşleşen kayıt bulunamadı
noMatchTextTry a different search term.Farklı bir arama deneyin.
clearSearchClear searchAramayı temizle
errorCouldn't load the listListe yüklenemedi
errorTextSomething went wrong while loading. You can try again.Yüklenirken bir sorun oluştu. Yeniden deneyebilirsiniz.
retryRetryYeniden dene
errorDetailDetailsAyrıntı
manualList not loaded yetListe henüz yüklenmedi
manualTextLoad the list when you need it.Listeyi gerektiğinde yükleyin.
loadLoadYükle
recordsrecordskayıt

search is the placeholder, searchLabel the accessible name of the search box. empty / emptyText show when there are no rows at all, noMatch / noMatchText when a search or filter matches nothing. manual* and load belong to load: "manual".

KeyEnglish (example output)Turkish (example output)
info(from, to, filtered, total)51–75 / 340 records (total 1,234)51–75 / 340 kayıt (toplam 1.234)
infoUnknown(from, to)51–75 shown51–75 gösteriliyor
totalUnknowntotal unknowntoplam bilinmiyor
pageSizePer pageSayfa başına
pagePageSayfa
pageOf(total)of 14/ 14
paginationPaginationSayfalama
firstFirst pageİlk sayfa
prevPrevious pageÖnceki sayfa
nextNext pageSonraki sayfa
lastLast pageSon sayfa
allAllTümü

info gets total = null when nothing is filtered out (then the parenthesis is left out). infoUnknown and totalUnknown are used when the server doesn't count. pagination names the pager landmark (followed by the grid's label), all is the -1 page size.

Announcements and landmarks ​

KeyEnglish (example output)Turkish (example output)
skipSkip tableTabloyu atla
regionLabelData tableVeri tablosu
sortedAsc(col)Sorted by Name, ascendingSıralama: Name, artan
sortedDesc(col)Sorted by Name, descendingSıralama: Name, azalan
sortClearedSorting clearedSıralama kaldırıldı
found(n)12 records found12 kayıt bulundu
pageAnnounce(page, pages)Page 2 of 14Sayfa 2 / 14
openRowOpen rowSatırı aç

skip is the "skip table" link text; regionLabel the fallback name of an unnamed grid (DG002); openRow the hidden header of the rowClick chevron column.

Errors ​

KeyEnglishTurkish
errNetworkThe server could not be reached. Check your connection.Sunucuya ulaşılamadı. Bağlantınızı kontrol edin.
errTimeoutThe server took too long to respond.Sunucu zamanında yanıt vermedi.
errSessionYour session has expired. Please sign in again.Oturumunuz sona erdi. Lütfen yeniden giriş yapın.
errForbiddenYou are not allowed to view this list.Bu listeyi görüntüleme yetkiniz yok.
errServer(status)The server returned an error (500).Sunucu bir hata döndürdü (500).
errParseThe server response could not be read.Sunucu yanıtı okunamadı.

A server's own message (JSON message, a validation error) is shown instead of errForbidden and errServer for 403, 410, 422 and 429 responses.

Dialogs and actions ​

KeyEnglishTurkish
confirmTitleAre you sure?Emin misiniz?
confirmOkConfirmOnayla
confirmCancelCancelVazgeç
actionDoneDone.İşlem tamamlandı.

Used by the built-in confirm dialog and grid.action() when the response has no message.

Module messages ​

Modules keep their own strings. Each takes a messages option (partial, merged over its pack) and picks Turkish or English by the grid's locale like the core.

js
colVis({ messages: { button: "Fields" } });
excel({ messages: { excel: "Spreadsheet (.xlsx)" } });

colVis ​

KeyEnglish
buttonColumns
legendShow / hide columns
showAllShow all
resetReset to default
searchFind column…
searchLabelFind column
noMatchNo matching columns
lockedThis column can't be hidden

colReorder ​

KeyEnglish (example output)
earlier(col)Move Name earlier
later(col)Move Name later
moved(col, pos, total)Name moved to position 2 of 6.
hintDrag to move

columnFilters ​

KeyEnglish (example output)
filter(col)Filter: Name
applyApply
clearClear
clearAllClear filters
valueValue
andand
active(n)2 filters
opsoperator labels, see below

ops maps every operator to its label: eq equals, ne not equal, gt greater than, gte at least, lt less than, lte at most, between between, in is any of, notIn is none of, contains contains, notContains does not contain, starts starts with, ends ends with, empty is empty, notEmpty is not empty. Override the whole ops object when you change it.

selection ​

KeyEnglish (example output)
selectedselected
idleSelect rows to enable actions
selectAll(n)Select all 340 matching
allSelectedAll matching records are selected.
clearClear selection
hidden(n)3 not shown
row(label)Select: Jill Valentine
pageSelect all on this page
columnSelect
barSelection
announce(n)3 rows selected
announceAll(n)All 340 matching rows selected
clearedSelection cleared
resetThe filter changed; select-all was cleared

actions ​

KeyEnglish (example output)
actionsActions
moreMore actions
forRow(label)Actions: Jill Valentine

excel, csv, print ​

The export modules share one menu and one message object.

KeyEnglish (example output)
menuExport
excelExcel (.xlsx)
csvCSV
printPrint
yesYes
noNo
recordsrecords
done(n)340 records exported
failedExport failed
truncated(n, total)Only the first 1,000 of 4,200 records were exported

button.reload, button.resetState ​

KeyEnglish
reloadReload
resetStateReset
resetStateTitleReset the view to its defaults

button.custom() and button.group() take their text from label.

softDeletes ​

KeyEnglish
labelShow deleted
KeyEnglish
pagePage total
totalTotal

responsive ​

KeyEnglish
showShow hidden columns
hideHide hidden columns

Released under the MIT License.