A free open source IT asset/license management system
Fixed #18355 - use translation strings for placeholder text in custom fields
snipe0319a4b7106d
diff --git a/resources/lang/en-US/admin/custom_fields/general.php b/resources/lang/en-US/admin/custom_fields/general.phpindex ca62dc5724..cc25c4d742 100644--- a/resources/lang/en-US/admin/custom_fields/general.php+++ b/resources/lang/en-US/admin/custom_fields/general.php@@ -21,6 +21,7 @@ return ['field_element_short' => 'Element','field_format' => 'Format','field_format_help' => 'Determines the validation rules that are applied. Some form elements may not be available to all formats.',+ 'enter_format_text' => 'Enter :format text','field_element_help' => 'Determines the UI element displayed in the form.','format_any_with_date_picker_help' => 'Pairing a date/datetime picker with the ANY/NONE format is useful when the field needs to be encrypted (encrypted fields must be stored as text). Otherwise the DATE or DATETIME format is recommended for better sorting and validation.','encrypt_disabled_for_date_format' => 'DATE and DATETIME formats cannot be encrypted because they are stored in native date columns, which only accept valid date values.',diff --git a/resources/views/models/custom_fields_form.blade.php b/resources/views/models/custom_fields_form.blade.phpindex 8d6d67c72d..1298b1fcda 100644--- a/resources/views/models/custom_fields_form.blade.php+++ b/resources/views/models/custom_fields_form.blade.php@@ -157,7 +157,9 @@// chance to normalize. The mask itself is the// authoritative cap.$macAttrs = $isMac ? ' inputmode="text" autocomplete="off"' : '';- $placeholder = $isMac ? 'AA:BB:CC:DD:EE:FF' : 'Enter '.strtolower($field->format).' text';+ $placeholder = $isMac+ ? 'AA:BB:CC:DD:EE:FF'+ : trans('admin/custom_fields/general.enter_format_text', ['format' => strtolower($field->format)]);@endphp@if ($format_icon)<div class="input-group">diff --git a/resources/views/models/custom_fields_form_bulk_edit.blade.php b/resources/views/models/custom_fields_form_bulk_edit.blade.phpindex ed68b6dcd4..d2b5952925 100644--- a/resources/views/models/custom_fields_form_bulk_edit.blade.php+++ b/resources/views/models/custom_fields_form_bulk_edit.blade.php@@ -161,7 +161,7 @@class="form-control{{ strtoupper($field->format) === 'MAC' ? ' mac-address-input' : '' }}"name="{{ $field->db_column_name() }}"@if (strtoupper($field->format) === 'MAC') inputmode="text" autocomplete="off" @endif- placeholder="{{ strtoupper($field->format) === 'MAC' ? 'AA:BB:CC:DD:EE:FF' : 'Enter '.strtolower($field->format).' text' }}">+ placeholder="{{ strtoupper($field->format) === 'MAC' ? 'AA:BB:CC:DD:EE:FF' : trans('admin/custom_fields/general.enter_format_text', ['format' => strtolower($field->format)]) }}">@endif@else<input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled>