From def8a177047ac78f1f1a8b3c4721bc13c8a2a04a Mon Sep 17 00:00:00 2001 From: Amp Date: Mon, 23 Nov 2026 10:08:05 +0000 Subject: [PATCH 1/3] follow localization conventions for forms 2 strings Co-authored-by: Duncan McClean --- lang/en/form-fieldtypes.php | 26 +++++++++++++++++++ lang/en/messages.php | 18 ++++++++++--- .../forms/builder/FieldtypeSelector.vue | 6 ++--- .../forms/builder/PageInspector.vue | 4 +-- .../forms/builder/RegularFormField.vue | 2 +- .../js/components/forms/builder/Section.vue | 13 +++++++--- .../forms/connections/ConnectionList.vue | 2 +- .../js/components/forms/logic/FieldLogic.vue | 2 +- .../js/components/forms/logic/LogicTree.vue | 2 +- .../js/components/forms/logic/PageLogic.vue | 2 +- .../forms/summary/insights/CheckedInsight.vue | 8 +++++- resources/js/pages/forms/Builder.vue | 5 ++-- src/Fieldtypes/Text.php | 20 +++++++------- src/Forms/Fields/FormFieldtype.php | 12 ++++++++- src/Forms/Fieldtypes/Banner.php | 1 - src/Forms/Fieldtypes/Checkboxes.php | 1 - src/Forms/Fieldtypes/Currency.php | 1 - src/Forms/Fieldtypes/DatePicker.php | 1 - src/Forms/Fieldtypes/Dictionary.php | 1 - src/Forms/Fieldtypes/Dropdown.php | 1 - src/Forms/Fieldtypes/Email.php | 1 - src/Forms/Fieldtypes/Group.php | 1 - src/Forms/Fieldtypes/Heading.php | 1 - src/Forms/Fieldtypes/ImageChoice.php | 1 - src/Forms/Fieldtypes/LongAnswer.php | 1 - src/Forms/Fieldtypes/MultiChoice.php | 1 - src/Forms/Fieldtypes/Name.php | 1 - src/Forms/Fieldtypes/Number.php | 1 - src/Forms/Fieldtypes/OpinionScale.php | 1 - src/Forms/Fieldtypes/Paragraph.php | 1 - src/Forms/Fieldtypes/Phone.php | 1 - src/Forms/Fieldtypes/Ranking.php | 1 - src/Forms/Fieldtypes/ShortAnswer.php | 1 - src/Forms/Fieldtypes/Spacer.php | 1 - src/Forms/Fieldtypes/StarRating.php | 1 - src/Forms/Fieldtypes/TimePicker.php | 1 - src/Forms/Fieldtypes/Toggle.php | 1 - src/Forms/Fieldtypes/Upload.php | 1 - src/Forms/Fieldtypes/Website.php | 1 - src/Forms/Fieldtypes/YesNo.php | 1 - 40 files changed, 90 insertions(+), 58 deletions(-) diff --git a/lang/en/form-fieldtypes.php b/lang/en/form-fieldtypes.php index 6ddb89b0ca8..432cc2ca227 100644 --- a/lang/en/form-fieldtypes.php +++ b/lang/en/form-fieldtypes.php @@ -1,17 +1,43 @@ 'A banner to highlight important information in your form.', + 'checkboxes.description' => 'Respondents can select multiple options from a list.', + 'currency.description' => 'Collects a monetary amount.', + 'date_picker.description' => 'Lets respondents pick a date.', + 'dictionary.description' => 'Select from a predefined list like countries, timezones, or currencies.', + 'dropdown.description' => 'A dropdown list where respondents pick from your options.', + 'email.description' => 'Collects an email address and ensures it\'s properly formatted.', + '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.', + 'long_answer.description' => 'A larger field for detailed responses, comments, or messages.', + 'multi_choice.description' => 'A question with a range of answer options. Respondents can only choose one answer.', + 'name.description' => 'Collects someone\'s name.', + 'number.description' => 'Collects a number. You can set minimum and maximum values.', '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.', '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.', + 'ranking.description' => 'A ranking input for ordering items by preference.', + 'short_answer.description' => 'A simple field for short, one-line answers.', + '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.', + 'time_picker.description' => 'Lets respondents pick a time of day.', + 'toggle.description' => 'A simple yes or no switch.', '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.', + 'website.description' => 'Collects a website address and ensures it\'s properly formatted.', + 'yes_no.description' => 'A simple yes or no question.', ]; diff --git a/lang/en/messages.php b/lang/en/messages.php index cbda9e8750e..e750521e4c7 100644 --- a/lang/en/messages.php +++ b/lang/en/messages.php @@ -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.', @@ -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' => ':count field on this form|:count 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.', @@ -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.', diff --git a/resources/js/components/forms/builder/FieldtypeSelector.vue b/resources/js/components/forms/builder/FieldtypeSelector.vue index 94d810df856..27b8f660517 100644 --- a/resources/js/components/forms/builder/FieldtypeSelector.vue +++ b/resources/js/components/forms/builder/FieldtypeSelector.vue @@ -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', @@ -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', @@ -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', diff --git a/resources/js/components/forms/builder/PageInspector.vue b/resources/js/components/forms/builder/PageInspector.vue index 472adc931eb..3671f6d4070 100644 --- a/resources/js/components/forms/builder/PageInspector.vue +++ b/resources/js/components/forms/builder/PageInspector.vue @@ -53,7 +53,7 @@ watch(() => page.value.instructions, dirty); - +