Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions lang/en/form-fieldtypes.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,96 @@
<?php

return [
'banner.description' => 'A banner to highlight important information in your form.',
'banner.example.content' => 'Please review the following information before continuing.',
'banner.example.display' => 'Important',
'checkboxes.description' => 'Respondents can select multiple options from a list.',
'checkboxes.example.display' => 'What toppings do you want?',
'checkboxes.example.options.anchovies' => 'Anchovies (brave choice)',
'checkboxes.example.options.mushrooms' => 'Mushrooms',
'checkboxes.example.options.pepperoni' => 'Pepperoni',
'checkboxes.example.options.pineapple' => 'Pineapple (controversial)',
'currency.description' => 'Collects a monetary amount.',
'currency.example.display' => 'How much do you usually spend on coffee per week?',
'date_picker.description' => 'Lets respondents pick a date.',
'date_picker.example.display' => 'What is your birthday?',
'dictionary.description' => 'Select from a predefined list like countries, timezones, or currencies.',
'dictionary.example.display' => 'Where have you been on vacation recently?',
'dropdown.description' => 'A dropdown list where respondents pick from your options.',
'dropdown.example.display' => 'What\'s your go-to karaoke song?',
'dropdown.example.options.bohemian' => 'Bohemian Rhapsody',
'dropdown.example.options.never' => 'Never Gonna Give You Up',
'dropdown.example.options.sweet' => 'Sweet Caroline',
'dropdown.example.options.wrecking' => 'I Will Survive',
'dropdown.example.placeholder' => 'Select a song...',
'email.description' => 'Collects an email address and ensures it\'s properly formatted.',
'email.example.display' => 'Email Address',
'email.example.value' => 'jamie@schmidt.family',
'group.description' => 'Group related fields together.',
'heading.description' => 'A heading to organize your form.',
'image_choice.config.aspect_ratio.instructions' => 'Shape of the image area for each option.',
'image_choice.config.columns.instructions' => 'How many options appear per row.',
'image_choice.description' => 'An image-based choice selector for visual options.',
'image_choice.example.display' => 'Pick your favorite season',
'image_choice.example.options.autumn' => 'Autumn',
'image_choice.example.options.spring' => 'Spring',
'image_choice.example.options.summer' => 'Summer',
'image_choice.example.options.winter' => 'Winter',
'long_answer.description' => 'A larger field for detailed responses, comments, or messages.',
'long_answer.example.display' => 'Tell us about your dream vacation',
'long_answer.example.value' => 'A cozy cabin in the mountains with a stack of books, endless coffee, and absolutely no wifi.',
'multi_choice.description' => 'A question with a range of answer options. Respondents can only choose one answer.',
'multi_choice.example.display' => 'Why were you late to work?',
'multi_choice.example.options.alarm' => 'My alarm didn\'t go off',
'multi_choice.example.options.racoon' => 'A raccoon stole my keys',
'multi_choice.example.options.traffic' => 'Traffic was bad',
'name.description' => 'Collects someone\'s name.',
'name.example.display' => 'Your Name',
'name.example.value' => 'Jamie Schmidt',
'number.description' => 'Collects a number. You can set minimum and maximum values.',
'number.example.display' => 'How many cups of coffee do you drink per day?',
'opinion_scale.config.high_label.instructions' => 'Shown below the highest value.',
'opinion_scale.config.low_label.instructions' => 'Shown below the lowest value.',
'opinion_scale.config.middle_label.instructions' => 'Shown below the middle value.',
'opinion_scale.description' => 'An opinion scale for measuring agreement or satisfaction.',
'opinion_scale.example.display' => 'How likely are you to recommend us?',
'opinion_scale.example.high_label' => 'Very likely',
'opinion_scale.example.low_label' => 'Not likely',
'paragraph.config.display.instructions' => "This won't be displayed to visitors. It's just for internal reference.",
'paragraph.description' => 'A paragraph to provide information in your form.',
'phone.description' => 'A field for collecting phone numbers.',
'phone.example.display' => 'Phone Number',
'phone.example.placeholder' => '(555) 123-4567',
'phone.example.value' => '(555) 867-5309',
'ranking.description' => 'A ranking input for ordering items by preference.',
'ranking.example.display' => 'Rank your favorite seasons',
'ranking.example.options.autumn' => 'Autumn',
'ranking.example.options.spring' => 'Spring',
'ranking.example.options.summer' => 'Summer',
'ranking.example.options.winter' => 'Winter',
'short_answer.description' => 'A simple field for short, one-line answers.',
'short_answer.example.display' => 'What\'s your secret talent?',
'short_answer.example.value' => 'I can whistle with crackers in my mouth',
'spacer.description' => 'Add visual spacing between form fields.',
'star_rating.config.allow_half_stars.instructions' => 'Allow ratings like 4.5.',
'star_rating.config.max_stars.instructions' => 'The maximum number of selectable stars.',
'star_rating.description' => 'A star rating input for collecting ratings.',
'star_rating.example.display' => 'How would you rate your experience?',
'time_picker.description' => 'Lets respondents pick a time of day.',
'time_picker.example.display' => 'When do you usually eat lunch?',
'toggle.description' => 'A simple yes or no switch.',
'toggle.example.display' => 'Agreement',
'toggle.example.inline_label' => 'I promise not to spoil the ending',
'upload.config.container.instructions' => 'Select which asset container to store the uploaded files.',
'upload.config.folder.instructions' => 'The folder within the container to upload files to.',
'upload.config.max_files.instructions' => 'The maximum number of files that may be uploaded.',
'upload.config.min_files.instructions' => 'The minimum number of files that must be uploaded.',
'upload.config.store.instructions' => 'Store uploaded files permanently in an asset container.',
'upload.description' => 'Upload files - store them permanently or use them temporarily.',
'upload.example.display' => 'Upload your resume',
'website.description' => 'Collects a website address and ensures it\'s properly formatted.',
'website.example.display' => 'Your Website',
'website.example.value' => 'https://schmidt.family',
'yes_no.description' => 'A simple yes or no question.',
'yes_no.example.display' => 'Would you recommend us to a friend?',
];
23 changes: 20 additions & 3 deletions lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
'entry_origin_instructions' => 'The new localization will inherit values from the entry in the selected site.',
'expect_root_instructions' => 'Consider the first page in the tree a "root" or "home" page.',
'field_conditions_always_save_instructions' => 'Always save the field value, even if the field is hidden.',
'field_conditions_reserve_space_when_hidden_instructions' => 'When hidden, reserve the field\'s space in the layout.',
'field_conditions_field_instructions' => 'You may enter any field handle. You are not limited to the options in the dropdown.',
'field_conditions_instructions' => 'When to show or hide this field.',
'field_conditions_reserve_space_when_hidden_instructions' => 'When hidden, reserve the field\'s space in the layout.',
Expand Down Expand Up @@ -165,8 +164,18 @@
'form_closed_message' => 'This form is no longer accepting submissions.',
'form_require_login_message' => 'You must be logged in to submit this form.',
'form_create_description' => 'Get started by creating your first form.',
'form_builder' => 'Form Builder',
'form_builder_delete_field_confirmation' => 'Are you sure you want to delete this field? This action cannot be undone.',
'form_builder_delete_page_confirmation' => 'Are you sure you want to delete this page? All sections and fields in this page will also be deleted.',
'form_builder_delete_section_confirmation' => 'Are you sure you want to delete this section? All fields in this section will also be deleted.',
'form_builder_empty_inspector' => 'Drag fields onto the form to add them. Click a field, section, or page to edit its settings here.',
'form_builder_empty_section' => 'Drag fields here to build your form or :link',
'form_builder_field_count' => '<strong>:count</strong> field on this form|<strong>:count</strong> fields on this form',
'form_builder_field_has_errors' => 'This field has errors. Please fix them before saving.',
'form_builder_link_existing_description' => 'Link one or more existing fields from a fieldset.',
'form_builder_page_break_description' => 'Page Breaks split a form into multiple steps, turning a long form into a more manageable, step-by-step experience.',
'form_builder_section_description' => 'Sections group fields into clearly defined areas, helping you structure, organize, and navigate your form.',
'form_builder_select_field_to_import' => 'Select a field or fieldset to import',
'form_connection_delete_confirmation' => 'Are you sure you want to delete this connection?',
'form_fake_submissions_deleted' => 'Deleted :count fake submission.|Deleted :count fake submissions.',
'form_fake_submissions_delete_failed' => 'Fake submissions could not be deleted.',
'form_fake_submissions_form_not_found' => 'Form could not be found for deleting fake submissions.',
Expand All @@ -176,9 +185,12 @@
'form_fake_submission_generated' => 'Fake submission generated.',
'form_fields_handle_instructions' => 'Auto-generated from the label. It can\'t be changed after saving the form.',
'form_fields_instructions_instructions' => 'Additional field instructions like this.',
'form_logic_field_empty_description' => 'Show or hide fields based on previous answers.',
'form_logic_imported_field_unsupported' => 'Logic can\'t be added to imported fields. Please edit the fieldset instead.',
'form_logic_page_empty_description' => 'Send users to different pages based on their answers.',
'form_navigation' => 'Form navigation',
'form_summary_add_chart_instructions' => 'Add a chart to start summarizing responses.',
'form_summary_checked_insight' => 'of users checked the toggle',
'form_summary_checked_insight' => ':metric of users checked the toggle',
'form_summary_other_breakdown' => ':field: Other breakdown: :values',
'form_export_filtered_description' => 'Exports only the submissions matching the current search and filters.',
'getting_started_widget_collections' => 'Collections hold the different content types that make up your site, helping you stay organized.',
Expand Down Expand Up @@ -277,6 +289,11 @@
'role_handle_instructions' => 'Unique identifier used in code and templates to reference this role.',
'role_intro' => 'Roles are groups of access and action permissions that can be assigned to users and user groups.',
'role_title_instructions' => 'Use a singular noun, such as \'Editor\' or \'Admin\'',
'sample_value_email' => 'name@example.com',
'sample_value_paragraph' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
'sample_value_phone' => '555-0100',
'sample_value_postcode' => '97477',
'sample_value_url' => 'https://example.com',
'search_utility_description' => 'Manage and view important information about Statamic\'s search indexes.',
'selections_click_to_deselect_all' => 'All :total items selected. Uncheck to deselect items.',
'selections_click_to_select_all' => 'No items selected. Check to select :total items.',
Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/forms/builder/FieldtypeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const allFieldtypes = computed(() => {
options.push({
handle: 'section',
title: __('Section'),
description: __('Sections group fields into clearly defined areas, helping you structure, organize, and navigate your form.'),
description: __('statamic::messages.form_builder_section_description'),
categories: ['structure'],
keywords: [],
icon: 'add-section',
Expand All @@ -33,7 +33,7 @@ const allFieldtypes = computed(() => {
options.push({
handle: 'page_break',
title: __('Page Break'),
description: __('Page Breaks split a form into multiple steps, turning a long form into a more manageable, step-by-step experience.'),
description: __('statamic::messages.form_builder_page_break_description'),
categories: ['structure'],
keywords: [],
icon: 'page',
Expand All @@ -46,7 +46,7 @@ const allFieldtypes = computed(() => {
options.push({
handle: 'fieldset',
title: __('Link Existing'),
description: __('Link one or more existing fields from a fieldset.'),
description: __('statamic::messages.form_builder_link_existing_description'),
categories: ['fieldsets'],
keywords: [],
icon: 'link',
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/forms/builder/PageInspector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ watch(() => page.value.instructions, dirty);
<Input v-model="page.display" :placeholder="placeholderTitle" focus />
</Field>

<Field :label="__('Help Text')" :instructions="__('Additional field instructions like this.')">
<Field :label="__('Help Text')" :instructions="__('statamic::messages.form_fields_instructions_instructions')">
<Textarea v-model="page.instructions" :rows="2" resize="vertical" />
</Field>
<Button
Expand All @@ -70,7 +70,7 @@ watch(() => page.value.instructions, dirty);
<ConfirmationModal
v-model:open="confirmingDelete"
:title="__('Delete Page')"
:body-text="__('Are you sure you want to delete this page? All sections and fields in this page will also be deleted.')"
:body-text="__('statamic::messages.form_builder_delete_page_confirmation')"
:button-text="__('Delete')"
danger
@confirm="handleDeletePage"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/forms/builder/RegularFormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const hasErrors = computed(() => {
:class="{ 'opacity-60': field.config.hidden }"
:label="__(field.config.display)"
:instructions="field.config.instructions"
:error="hasErrors ? __('This field has errors. Please fix them before saving.') : null"
:error="hasErrors ? __('statamic::messages.form_builder_field_has_errors') : null"
>
<template #label>
<Label :class="['', { 'cursor-pointer': !isInspecting }]">
Expand Down
13 changes: 9 additions & 4 deletions resources/js/components/forms/builder/Section.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const addLinkFieldsPlaceholder = () => {
dirty();
};

const [emptySectionTextBefore, emptySectionTextAfter] = __('statamic::messages.form_builder_empty_section')
.split(':link')
.map((text) => text.trim());

const toggleCollapsed = () => {
props.section.collapsibleInteracted = true;
props.section.collapsed = !props.section.collapsed;
Expand Down Expand Up @@ -212,8 +216,9 @@ const isFieldInLastRow = (index): boolean => index >= rowBoundaries.value.lastRo
:class="{ 'h-[670px]': isOnlySection, 'h-[200px]': !isOnlySection }"
>
<div>
<span class="text-zinc-500 mr-2">{{ __('Drag fields here to build your form or') }}</span>
<span v-if="emptySectionTextBefore" class="text-zinc-500 mr-2">{{ emptySectionTextBefore }}</span>
<Button size="xs" pill icon="link" :text="__('Link Existing')" @click="addLinkFieldsPlaceholder" />
<span v-if="emptySectionTextAfter" class="text-zinc-500 ml-2">{{ emptySectionTextAfter }}</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -248,7 +253,7 @@ const isFieldInLastRow = (index): boolean => index >= rowBoundaries.value.lastRo
class="border border-dashed rounded-lg p-4 flex items-center justify-center"
@click.stop="isInspectingLinkFields(field) || inspectLinkFields(field)"
>
<span class="text-zinc-500 mr-2">{{ __('Select a field or fieldset to import') }}</span>
<span class="text-zinc-500 mr-2">{{ __('statamic::messages.form_builder_select_field_to_import') }}</span>
</div>

<ImportField
Expand Down Expand Up @@ -281,7 +286,7 @@ const isFieldInLastRow = (index): boolean => index >= rowBoundaries.value.lastRo
<ConfirmationModal
v-model:open="confirmingDelete"
:title="__('Delete Section')"
:body-text="__('Are you sure you want to delete this section? All fields in this section will also be deleted.')"
:body-text="__('statamic::messages.form_builder_delete_section_confirmation')"
:button-text="__('Delete')"
danger
@confirm="deleteSection"
Expand All @@ -290,7 +295,7 @@ const isFieldInLastRow = (index): boolean => index >= rowBoundaries.value.lastRo
<ConfirmationModal
v-model:open="confirmingFieldDeletion"
:title="__('Delete Field')"
:body-text="__('Are you sure you want to delete this field? This action cannot be undone.')"
:body-text="__('statamic::messages.form_builder_delete_field_confirmation')"
:button-text="__('Delete')"
danger
@confirm="deleteField"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const props = withDefaults(defineProps<{
rules: true,
addLabel: () => __('Add Connection'),
deleteHeading: () => __('Delete Connection'),
deleteDescription: () => __('Are you sure you want to delete this connection?'),
deleteDescription: () => __('statamic::messages.form_connection_delete_confirmation'),
});

const sortableItemClass = 'connection-item';
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/forms/logic/FieldLogic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ watch(
<LogicEmptyState
v-if="fieldsWithLogic.length === 0"
:heading="__('No field logic yet')"
:description="__('Show or hide fields based on previous answers.')"
:description="__('statamic::messages.form_logic_field_empty_description')"
>
<AddLogicRuleButton
v-if="availableFields.length > 0"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/forms/logic/LogicTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ onUnmounted(() => {
'ring-1 ring-blue-500': isFieldSelected(field),
}"
:style="fieldConnection(field) ? { '--end-connection': fieldConnection(field).endConnection } : null"
v-tooltip="field.type === 'import' ? __(`Logic can't be added to imported fields. Please edit the fieldset instead.`) : null"
v-tooltip="field.type === 'import' ? __('statamic::messages.form_logic_imported_field_unsupported') : null"
@click="selectField(field)"
>
<LogicTreeFieldset v-if="field.type === 'import'" :field="field" />
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/forms/logic/PageLogic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ watch(
<LogicEmptyState
v-if="rules.length === 0"
:heading="__('No page logic yet')"
:description="__('Send users to different pages based on their answers.')"
:description="__('statamic::messages.form_logic_page_empty_description')"
>
<AddLogicRuleButton
v-if="availablePages.length > 0"
Expand Down
Loading
Loading