How to translate dates & times in the Bootstrap admin panel?

PHP CRUD Generator uses 2 different language settings for dates and times:

  • The PHP Locale for date & time in the Bootstrap Admin Panel READ lists
  • The Datepicker plugin translation for date & time in the Bootstrap Admin Panel CREATE/UPDATE forms

PHP Locale Language setting

PHP Locale Language is used in Admin Panel READ lists for date & time fields.

To change PHP Locale Language:

  1. Open generator/generator.php in your browser
  2. Click the General Settings button
    PHP CRUD General Settings button
  3. Choose your language in "Date/Time translation for Admin lists" then validate changes.
    PHP CRUD General Settings - languages

More informations about PHP Locale languages: https://php.net/manual/en/class.locale.php


Datepicker plugin

The Datepicker plugin is used in:

  • Bootstrap Admin Panel READ lists with Edit in place date inputs
  • Bootstrap Admin Panel CREATE/UPDATE forms for date & time inputs

To change Datepicker plugin Language:

  1. Open generator/generator.php in your browser
  2. Click the General Settings button
    PHP CRUD General Settings button
  3. Choose your language in "Date & Time pickers language" then validate changes.
    PHP CRUD General Settings - languages

The available languages are located in class/phpformbuilder/plugins/material-datepicker/dist/i18n.
You can add your own language if it's not present, then go back to the form, the new language will be detected & shown in the dropdown list.


Method 2:

  1. Open conf/user-conf.json
  2. Set locale_default value to a valid PHP Locale language code
  3. Set datetimepickers_lang value to an available language in class/phpformbuilder/plugins/material-datepicker/dist/i18n

PHP CRUD tutorial main page