ArtiGrid
change the language of the actions
By default, ArtiGrid renders every interface text (buttons, messages, pagination and confirmations) in English. The ->lang() method lets you override those labels to match your application's language, without touching the library core.
You just pass an associative array where the key is the internal identifier of the text and the value is the translation you want to display. In this example we translate elements such as navigation (prev, next), actions (add, delete, actions), the search box and the confirmation messages for bulk operations into Spanish.
You don't have to define every key: any you omit will keep its default English value. This gives you the flexibility to translate only what you need, or to keep a centralized dictionary and reuse it across all your grids.
<?php
$grid = new ArtiGrid();
$grid->table('payments')
->template('bootstrap5')
->advancedFilterOpen(true)
->advancedFilterPosition('left')
->advancedFilterTitle('Filtros Avanzados')
->advancedFilter('checkNumber', 'text', [], [
'label' => 'número de comprobación',
'placeholder' => 'Buscar por número de comprobación...',
'operator' => 'LIKE'
])
->setAdvancedFilterTemplate('
<div class="row g-3">
<div class="col-md-12">{checkNumber}</div>
</div>
')
->colRename("checkNumber", "número de comprobación")
->lang([
'prev' => 'Anterior', /* Renames the "Previous" button in pagination */
'actions' => 'Acciones', /* Renames the "Actions" column in the grid */
'next' => 'Siguiente', /* Renames the "Next" button in pagination */
'search' => 'Buscar...', /* Renames the search placeholder */
'add' => 'Agregar', /* Renames the "Add" button text */
'filter' => 'Filtrar', /* Renames the text "filter" in the filter columns of the grid */
'All' => 'Todos', /* Renames the "All" option in the search filter */
'back' => 'Regresar', /* Renames the "Back" button in the grid form */
'Yes_bulk_delete' => 'Sí', /* Rename the text in the multiple delete modal button */
'Yes_delete' => 'Sí', /* Renames the text in the modal button when deleting a single record */
'edit_multiple' => 'Editar varios', /* Renames the bulk edit button text */
'bulkDeleteTitle' => 'Eliminar', /* Renames the title of the bulk delete confirmation dialog */
'delete_multiple' => 'Eliminar seleccionados', /* Renames the bulk delete button text */
'bulkEditTitle' => 'Desea Editar', /* Renames the title of the bulk edit dialog */
'bulkEditDescription' => 'En el siguiente paso, podrá elegir qué campos actualizar.', /* Renames the description displayed in the bulk edit dialog */
'delete' => 'Eliminar', /* Renames the title in the modal when deleting a record */
'This_action_delete' => 'Esta acción no se puede deshacer.', /* Renames the text in the modal when deleting a record */
'This_action_bulk_delete' => 'Esta acción no se puede deshacer.', /* Renames the text in the modal when deleting multiple records */
'Deleted' => 'Eliminado', /* Renames the title shown after deleting a record */
'deleted_successfully' => 'Registro Eliminado con éxito', /* Renames the success message displayed after deleting a record */
'records' => 'Registros', /* Renames the "Records" label */
'continue' => 'Continuar', /* Renames the "Continue" button in dialogs */
'cancel' => 'Cancelar', /* Renames the "Cancel" button in dialogs */
'saved' => 'Guardado', /* Renames the message shown after saving a record */
'updated' => 'Actualizar', /* Renames the message shown after updating a record */
'clear_filter' => 'Limpiar Filtro', /* Renames the text of the "Clear Advanced Filters" button */
'no_active_filters' => 'sin filtros activos', /* Rename the text of the filters that are not active */
'active_filter' => 'filtro activo' /* Renames the text of the active filters */
]);
echo $grid->render();
?>