From 21dca4dd85b9477213b991da262a6744d81aa3cd Mon Sep 17 00:00:00 2001 From: Christian Tosta Date: Fri, 27 Oct 2023 10:35:27 -0300 Subject: [PATCH] Added new icons and brazilian translation --- Plugin.php | 14 +- assets/icon-forms.svg | 3 + lang/pt-br/lang.php | 381 ++++++++++++++++++++++++++++++++++++++++++ plugin.yaml | 7 +- updates/version.yaml | 5 +- 5 files changed, 399 insertions(+), 11 deletions(-) create mode 100644 assets/icon-forms.svg create mode 100644 lang/pt-br/lang.php diff --git a/Plugin.php b/Plugin.php index f8d637f..a38f595 100644 --- a/Plugin.php +++ b/Plugin.php @@ -33,13 +33,13 @@ public function registerSettings() { return [ 'settings' => [ - 'label' => 'Custom Forms', - 'description' => 'Simple multipurpose form builder', - 'category' => 'Small plugins', - 'icon' => 'icon-inbox', - 'class' => 'ABWebDevelopers\Forms\Models\Settings', - 'keywords' => 'form custom contact abweb recaptcha antispam', - 'order' => 555, + 'label' => 'abwebdevelopers.forms::lang.settings.plugin.label', + 'description' => 'abwebdevelopers.forms::lang.settings.plugin.description', + 'category' => 'abwebdevelopers.forms::lang.settings.plugin.category', + 'icon' => 'icon-cog', + 'class' => 'ABWebDevelopers\Forms\Models\Settings', + 'keywords' => 'form custom contact abweb recaptcha antispam', + 'order' => 555, 'permissions' => ['abwebdevelopers.forms.access_settings'], ] ]; diff --git a/assets/icon-forms.svg b/assets/icon-forms.svg new file mode 100644 index 0000000..1ab83df --- /dev/null +++ b/assets/icon-forms.svg @@ -0,0 +1,3 @@ + + + diff --git a/lang/pt-br/lang.php b/lang/pt-br/lang.php new file mode 100644 index 0000000..0cc4f18 --- /dev/null +++ b/lang/pt-br/lang.php @@ -0,0 +1,381 @@ + [ + 'name' => 'Formulários', + 'description' => 'Crie formulários personalizados que podem ser adicionados às suas páginas através de componentes.', + ], + 'settings' => [ + 'plugin' => [ + 'category' => 'Formulários', + 'label' => 'Configurações', + 'description' => 'Gerencie as configurações de cache, ações de eventos, antispam, privacidade, envio de emails e estilos dos formulários.', + ], + ], + 'tabs' => [ + 'fields' => 'Campos', + 'privacy' => 'Privacidade', + 'antispam' => 'Antispam', + 'styling' => 'Estilos', + 'emailing' => 'Envio de Emails', + 'caching' => 'Cache', + 'action' => 'Ações', + 'validation' => 'Validação', + 'options' => 'Opções', + 'html_attributes' => 'Atributos HTML', + ], + 'sections' => [ + 'buttons' => [ + 'label' => 'Button Styling', + ], + 'recaptcha' => [ + 'label' => 'Google ReCAPTCHA', + ], + 'ip_restriction' => [ + 'label' => 'IP Restrictions', + ], + 'auto_reply' => [ + 'label' => 'Automatic Replies', + ], + 'styling' => [ + 'label' => 'Form Styling', + 'comment' => 'All of the below can be overridden, per form and/or field', + ], + 'validation' => [ + 'label' => 'Validation Styling', + 'comment' => 'All of the below can be overridden, per form' + ], + 'notifications' => [ + 'label' => 'Automatic Notifications', + ], + ], + 'forms' => [ + 'field' => [ + 'title' => 'Título', + 'code' => 'Código', + ], + ], + 'mail' => [ + 'templates' => [ + 'autoreply' => 'ABWebDevelopers Forms - Auto-reply Message', + 'notification' => 'ABWebDevelopers Forms - Notification Message', + ] + ], + 'customForm' => [ + 'formCode' => [ + 'title' => 'Usar Formulário', + 'description' => 'Defina o formulário para uso por este código', + ], + 'validation' => [ + 'recaptchaFailed' => 'You must complete the reCAPTCHA verification', + 'noData' => 'No data supplied', + 'invalidNotificationRecipients' => 'Notification recipients list contains invalid email address', + 'noAutoReplyEmailField' => 'Auto-reply Email field could not be resolved', + 'noAutoReplyNameField' => 'Auto-reply Name field could not be resolved', + ] + ], + 'permissions' => [ + 'forms' => 'Manage forms', + 'submissions' => 'Manage submissions', + ], + 'models' => [ + 'all' => [ + 'created_at' => [ + 'label' => 'Criado em', + ], + 'updated_at' => [ + 'label' => 'Atualizado em', + ], + 'sort_order' => [ + 'label' => 'Ordem', + 'up' => 'Acima', + 'down' => 'Abaixo', + 'successful_up' => 'Campo movido acima com sucesso', + 'successful_down' => 'Campo movido abaixo com sucesso', + ], + 'override' => [ + 'label' => 'Sobrescrever valor do sistema', + 'comment' => 'Ativo: Sobrescrever | Inativo: Herdar' + ], + ], + 'settings' => [ + 'enable_caching' => [ + 'label' => 'Enable Caching', + 'comment' => 'Choose whether or not cache the rendered form' + ], + 'cache_lifetime' => [ + 'label' => 'Cache Lifetime', + 'comment' => 'Amount of minutes to cache the rendered form for' + ], + 'form_class' => [ + 'label' => 'Form Class', + 'comment' => 'CSS Class for the Form', + ], + 'field_class' => [ + 'label' => 'Field Class', + 'comment' => 'CSS Class for the Field', + ], + 'row_class' => [ + 'label' => 'Row Class', + 'comment' => 'CSS Class for the Row', + ], + 'group_class' => [ + 'label' => 'Group Class', + 'comment' => 'CSS Class for the Group', + ], + 'label_class' => [ + 'label' => 'Label Class', + 'comment' => 'CSS Class for the Label', + ], + 'submit_class' => [ + 'label' => 'Submit Class', + 'comment' => 'CSS Class of the submit button', + ], + 'submit_text' => [ + 'label' => 'Submit Text', + 'comment' => 'Text to display in the submit button', + ], + 'enable_cancel' => [ + 'label' => 'Enable Cancel', + 'comment' => 'Will go back to referer if clicked', + ], + 'cancel_class' => [ + 'label' => 'Cancel Class', + 'comment' => 'CSS Class of the cancel button (if enabled)', + ], + 'cancel_text' => [ + 'label' => 'Cancel Text', + 'comment' => 'Text to display in the cancel button (if enabled)', + ], + 'saves_data' => [ + 'label' => 'Save Data?', + 'comment' => 'Choose whether or not to save submission data to the database (recommended)', + ], + 'store_ips' => [ + 'label' => 'Store IP Addresses?', + 'comment' => 'Choose whether or not to store IP addresses along with submissions', + ], + 'enable_recaptcha' => [ + 'label' => 'Enable Recpatcha', + 'comment' => 'Should this Form require recpatcha?', + ], + 'recaptcha_public_key' => [ + 'label' => 'ReCAPTCHA Public Key', + 'comment' => 'Google ReCAPTCHA (Public) API Key', + ], + 'recaptcha_secret_key' => [ + 'label' => 'ReCAPTCHA Secret Key', + 'comment' => 'Google ReCAPTCHA (Private) API Key', + ], + 'enable_ip_restriction' => [ + 'label' => 'Enable IP Restriction', + 'comment' => 'Choose to enable an IP restriction for this form', + ], + 'max_requests_per_day' => [ + 'label' => 'Max Requests Per Day', + 'comment' => 'Maximum amount of daily submissions', + ], + 'throttle_message' => [ + 'label' => 'Throttle Message', + 'comment' => 'Choose what to display to a user who has exceeded their daily submissions', + ], + 'queue_emails' => [ + 'label' => 'Queue Emails?', + 'comment' => 'Choose whether or not to add emails to the queue rather than sending synchronously (recommened)' + ], + 'send_notifications' => [ + 'label' => 'Send Notifications', + 'comment' => 'Decide if you would like to receive notifications for each submission. Can be overridden, per form', + ], + 'notification_template' => [ + 'label' => 'Notification Template', + 'comment' => 'Custom email template code (Settings > Email templates)', + ], + 'notification_recipients' => [ + 'label' => 'Notification Recipients', + 'comment' => 'Comma separated email addresses', + ], + 'auto_reply' => [ + 'label' => 'Auto Reply?', + 'comment' => 'Send automated reply to user who submits this form. Fields must be configured, per form', + ], + 'auto_reply_email_field_id' => [ + 'label' => 'Auto Reply Email Field', + 'comment' => 'Select the field to use as the email address to auto reply to', + ], + 'auto_reply_name_field_id' => [ + 'label' => 'Auto Reply Name Field', + 'comment' => 'Select the field to use as the name when auto replying', + ], + 'notif_replyto' => [ + 'label' => 'Add Reply-To Header?', + 'comment' => 'Set the reply-to header in notification emails to point to the user\'s email', + ], + 'notif_replyto_email_field_id' => [ + 'label' => 'Notification Reply-To Email Field', + 'comment' => 'Select the field to use as the email address to auto reply to', + ], + 'notif_replyto_name_field_id' => [ + 'label' => 'Notification Reply-To Name Field', + 'comment' => 'Select the field to use as the name when auto replying', + ], + 'auto_reply_template' => [ + 'label' => 'Auto Reply Template', + 'comment' => 'Custom email template code (Settings > Email templates)', + ], + 'field_error_class' => [ + 'label' => 'Field Error Class', + 'comment' => 'CSS Class to apply to a field on error', + ], + 'field_success_class' => [ + 'label' => 'Field Success Class', + 'comment' => 'CSS Class to apply to a field on success', + ], + 'label_error_class' => [ + 'label' => 'Label Error Class', + 'comment' => 'CSS Class to apply to a label on error', + ], + 'label_success_class' => [ + 'label' => 'Label Success Class', + 'comment' => 'CSS Class to apply to a label on success', + ], + 'form_error_class' => [ + 'label' => 'Form Error Class', + 'comment' => 'CSS Class to apply to a form on error', + ], + 'form_success_class' => [ + 'label' => 'Form Success Class', + 'comment' => 'CSS Class to apply to a form on success', + ], + 'on_success' => [ + 'label' => 'On Success Action', + 'comment' => 'Choose what to do when the form is successfully submitted', + 'options' => [ + 'hide' => 'Hide form', + 'clear' => 'Clear/reset the form', + 'redirect' => 'Redirect to URL' + ], + ], + 'on_success_message' => [ + 'label' => 'On Success Message', + 'comment' => 'Choose what to flash when the form is successfully submitted', + 'placeholder' => 'Message successfully sent' + ], + 'on_success_redirect' => [ + 'label' => 'On Success Redirect', + 'comment' => 'Choose what URL to redirect to when the form is successfully submitted', + 'placeholder' => '/thank-you' + ] + ], + 'form' => [ + 'title' => [ + 'label' => 'Título', + 'comment' => 'O título do formulário (usado em emails, etc)' + ], + 'code' => [ + 'label' => 'Código', + 'comment' => 'O código do formulário (somente snake_case)' + ], + 'description' => [ + 'label' => 'Descrição', + 'comment' => 'Uma pequena descrição a respeito do propósito dos formulários' + ], + ], + 'field' => [ + 'name' => [ + 'label' => 'Nome', + 'comment' => 'Used as the label for this field', + ], + 'code' => [ + 'label' => 'Código', + 'comment' => 'Used to identify this field. Must be in snake_case', + ], + 'type' => [ + 'label' => 'Tipo', + 'comment' => 'Choose the type of field', + ], + 'description' => [ + 'label' => 'Descrição', + 'comment' => 'Optional. A description of this field', + ], + 'placeholder' => [ + 'label' => 'Placeholder', + 'comment' => 'Enter the placeholder attribute value here. For select elements, it acts as an option.', + ], + 'default' => [ + 'label' => 'Valor padrão', + 'comment' => 'The default value. For select/radio/checkboxes use the code of the option.', + ], + 'show_description' => [ + 'label' => 'Mostrar Descrição', + 'comment' => 'Show the description in the form under the field\'s label?', + ], + 'required' => [ + 'label' => 'Requerido', + 'comment' => 'Synonymous for adding the "required" validation rule', + ], + 'validation_rules' => [ + 'label' => 'Validation Rules', + 'comment' => 'See documentation for more info: https://octobercms.com/docs/services/validation#available-validation-rules', + ], + 'validation_message' => [ + 'label' => 'Validation Message', + 'comment' => 'What message should be shown on failure', + ], + 'options' => [ + 'label' => 'Options', + 'comment' => 'Add your select, radio or checkbox options here', + 'prompt' => 'Add an option', + 'fields' => [ + 'option_label' => [ + 'label' => 'Option Label', + 'comment' => 'Used as the label for this option' + ], + 'option_code' => [ + 'label' => 'Option Code', + 'comment' => 'Used to identify this field. Must be in snake_case' + ], + 'is_optgroup' => [ + 'label' => 'Add sub options?', + 'comment' => 'Adding sub options will turn this option into a group of options (specifically an ``)' + ], + 'options' => [ + 'label' => 'Sub Options', + 'comment' => 'Add sub options to this option group', + 'fields' => [ + 'option_label' => [ + 'label' => 'Option Label', + 'comment' => 'Used as the label for this option' + ], + 'option_code' => [ + 'label' => 'Option Code', + 'comment' => 'Used to identify this field. Must be in snake_case' + ] + ] + ], + ] + ], + 'html_attributes' => [ + 'label' => 'HTML Attributes', + 'comment' => 'Add/override custom attributes for the field (input, select, textarea).', + 'prompt' => 'Add an attribute', + 'fields' => [ + 'attribute_name' => [ + 'label' => 'Attribute Name', + 'comment' => 'The name of the attribute, e.g. data-id, title, class, etc', + ], + 'attribute_value' => [ + 'label' => 'Attribute Value', + 'comment' => 'The value of the attribute. For boolean attributes, leave blank.', + ], + ] + ], + 'show_in_email_autoreply' => [ + 'label' => 'Show in autoreply emails', + 'comment' => 'Should this field\'s value show in the autoreply emails', + ], + 'show_in_email_notification' => [ + 'label' => 'Show in notification emails', + 'comment' => 'Should this field\'s value show in notification emails', + ], + ] + ] +]; diff --git a/plugin.yaml b/plugin.yaml index a261a10..4220860 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -6,9 +6,10 @@ plugin: homepage: '' navigation: bradie-forms: - label: 'Custom Forms' + label: 'abwebdevelopers.forms::lang.plugin.name' url: abwebdevelopers/forms/form - icon: icon-list-alt + icon: icon-wpforms + iconSvg: 'plugins/abwebdevelopers/forms/assets/icon-forms.svg' order: 500 permissions: - abwebdevelopers.forms.forms @@ -32,4 +33,4 @@ permissions: label: 'abwebdevelopers.forms::lang.permissions.forms' abwebdevelopers.forms.submissions: tab: 'abwebdevelopers.forms::lang.plugin.name' - label: 'abwebdevelopers.forms::lang.permissions.submissions' \ No newline at end of file + label: 'abwebdevelopers.forms::lang.permissions.submissions' diff --git a/updates/version.yaml b/updates/version.yaml index f1b6c13..adb9d29 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -54,4 +54,7 @@ 1.5.1: - 'Add default value support for select dropdowns' 1.6.0: - - Fix / Correctly use the Form Class style rules (may break styling in rare situations) \ No newline at end of file + - Fix / Correctly use the Form Class style rules (may break styling in rare situations) +1.7.0: + - 'Added pt-br translations and some i18n fixes' + - 'Added SVG icon and changed others'