Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language pack support #14

Merged
merged 5 commits into from
Sep 9, 2023
Merged
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
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"lint-prefixed": "phpcs --standard=phpcs-prefixed.xml.dist",
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
"test": "phpunit",
"makepot": "wp i18n make-pot . --exclude=\"node_modules,vendor,vendor_prefixed\" --headers='{\"Last-Translator\":\"info@omniform.io\",\"Language-Team\":\"info@omniform.io\",\"Report-Msgid-Bugs-To\":\"https://omniform.io/contact\"}'",
"build-release": [
"rm -r ./vendor",
"@composer dump-autoload",
Expand Down
7 changes: 0 additions & 7 deletions includes/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,4 @@ public function activation() {
public function deactivation() {
do_action( 'omniform_deactivate' );
}

/**
* Load language files.
*/
public function load_text_domain() {
load_plugin_textdomain( 'omniform', false, $this->base_path( 'languages' ) );
}
}
24 changes: 12 additions & 12 deletions includes/BlockLibrary/BlockPatterns/appointment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,61 @@
'content' => '
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:heading {"className":"wp-block-heading"} -->
<h2 class="wp-block-heading">Book an Appointment</h2>
<h2 class="wp-block-heading">' . esc_html__( 'Book an Appointment', 'omniform' ) . '</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Please fill out the form below to make an appointment.</p>
<p>' . esc_html__( 'Please fill out the form below to make an appointment.', 'omniform' ) . '</p>
<!-- /wp:paragraph -->

<!-- wp:omniform/fieldset {"fieldLabel":"Your Name","fieldName":"your-name"} -->
<!-- wp:omniform/fieldset {"fieldLabel":"' . esc_html__( 'Your Name', 'omniform' ) . '","fieldName":"' . esc_attr__( 'your-name', 'omniform' ) . '"} -->
<!-- wp:group {"style":{"spacing":{}},"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between","verticalAlignment":"center"}} -->
<div class="wp-block-group"><!-- wp:omniform/field {"fieldLabel":"First Name","fieldName":"first-name","style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<div class="wp-block-group"><!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'First Name', 'omniform' ) . '","fieldName":"' . esc_attr__( 'first-name', 'omniform' ) . '","style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/input /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"Last Name","fieldName":"last-name","style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Last Name', 'omniform' ) . '","fieldName":"' . esc_attr__( 'last-name', 'omniform' ) . '","style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/input /-->
<!-- /wp:omniform/field --></div>
<!-- /wp:group -->
<!-- /wp:omniform/fieldset -->

<!-- wp:omniform/field {"fieldLabel":"Phone Number","fieldName":"phone-number"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Phone Number', 'omniform' ) . '","fieldName":"' . esc_attr__( 'phone-number', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/input {"fieldType":"tel"} /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"Email","fieldName":"email"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Email', 'omniform' ) . '","fieldName":"' . esc_attr__( 'email', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/input {"fieldType":"email"} /-->
<!-- /wp:omniform/field -->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"}} -->
<div class="wp-block-group"><!-- wp:omniform/field {"fieldLabel":"Preferred Date","fieldName":"preferred-date","style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<div class="wp-block-group"><!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Preferred Date', 'omniform' ) . '","fieldName":"' . esc_attr__( 'preferred-date', 'omniform' ) . '","style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/input {"fieldType":"date"} /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"Preferred Time","fieldName":"preferred-time","style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Preferred Time', 'omniform' ) . '","fieldName":"' . esc_attr__( 'preferred-time', 'omniform' ) . '","style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/select -->
<!-- wp:omniform/select-option {"fieldLabel":"Morning"} /-->
<!-- wp:omniform/select-option {"fieldLabel":"' . esc_html__( 'Morning', 'omniform' ) . '"} /-->

<!-- wp:omniform/select-option {"fieldLabel":"Afternoon"} /-->
<!-- wp:omniform/select-option {"fieldLabel":"' . esc_html__( 'Afternoon', 'omniform' ) . '"} /-->
<!-- /wp:omniform/select -->
<!-- /wp:omniform/field --></div>
<!-- /wp:group -->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:omniform/button {"buttonType":"submit","buttonLabel":"Leave a Request"} /--></div>
<div class="wp-block-group"><!-- wp:omniform/button {"buttonType":"submit","buttonLabel":"' . esc_html__( 'Leave a Request', 'omniform' ) . '"} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
',
Expand Down
10 changes: 5 additions & 5 deletions includes/BlockLibrary/BlockPatterns/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
'content' => '
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:heading -->
<h2 class="wp-block-heading">Contact Us</h2>
<h2 class="wp-block-heading">' . esc_html__( 'Contact Us', 'omniform' ) . '</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If you have any questions or comments, or if you\'d like to work with me or collaborate on a project, please don\'t hesitate to get in touch. I look forward to hearing from you!</p>
<p>' . esc_html__( 'If you have any questions or comments, or if you\'d like to work with me or collaborate on a project, please don\'t hesitate to get in touch. I look forward to hearing from you!', 'omniform' ) . '</p>
<!-- /wp:paragraph -->

<!-- wp:omniform/field {"fieldLabel":"Your email address","fieldName":"your-email-address"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Your email address', 'omniform' ) . '","fieldName":"' . esc_attr__( 'your-email-address', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/input /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"Your message","fieldName":"your-message"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Your message', 'omniform' ) . '","fieldName":"' . esc_attr__( 'your-message', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/textarea {"style":{"dimensions":{"minHeight":"230px"}}} /-->
<!-- /wp:omniform/field -->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:omniform/button {"buttonType":"submit","buttonLabel":"Send Message"} /--></div>
<div class="wp-block-group"><!-- wp:omniform/button {"buttonType":"submit","buttonLabel":"' . esc_html__( 'Send Message', 'omniform' ) . '"} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
',
Expand Down
36 changes: 18 additions & 18 deletions includes/BlockLibrary/BlockPatterns/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,85 +10,85 @@
'content' => '
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:heading -->
<h2 class="wp-block-heading">Feedback</h2>
<h2 class="wp-block-heading">' . esc_html__( 'Feedback', 'omniform' ) . '</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We value your feedback! Please take a moment to fill out our website feedback form to let us know how we can improve your experience. Your input is important to us and we appreciate your time. Thank you for visiting our website.</p>
<p>' . esc_html__( 'We value your feedback! Please take a moment to fill out our website feedback form to let us know how we can improve your experience. Your input is important to us and we appreciate your time. Thank you for visiting our website.', 'omniform' ) . '</p>
<!-- /wp:paragraph -->

<!-- wp:omniform/field {"fieldLabel":"Name","fieldName":"name"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Name', 'omniform' ) . '","fieldName":"' . esc_attr__( 'name', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/input /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"Email","fieldName":"email"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Email', 'omniform' ) . '","fieldName":"' . esc_attr__( 'email', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/input {"fieldType":"email"} /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"Is this your first time visiting our site?","fieldName":"is-this-your-first-time-visiting-our-site"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Is this your first time visiting our site?', 'omniform' ) . '","fieldName":"' . esc_attr__( 'is-this-your-first-time-visiting-our-site', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/select -->
<!-- wp:omniform/select-option {"fieldLabel":"No"} /-->
<!-- wp:omniform/select-option {"fieldLabel":"' . esc_html__( 'No', 'omniform' ) . '"} /-->

<!-- wp:omniform/select-option {"fieldLabel":"Yes"} /-->
<!-- wp:omniform/select-option {"fieldLabel":"' . esc_html__( 'Yes', 'omniform' ) . '"} /-->
<!-- /wp:omniform/select -->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"Did you find what you were looking for?","fieldName":"did-you-find-what-you-were-looking-for"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Did you find what you were looking for?', 'omniform' ) . '","fieldName":"' . esc_attr__( 'did-you-find-what-you-were-looking-for', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/select -->
<!-- wp:omniform/select-option {"fieldLabel":"No"} /-->
<!-- wp:omniform/select-option {"fieldLabel":"' . esc_html__( 'No', 'omniform' ) . '"} /-->

<!-- wp:omniform/select-option {"fieldLabel":"Yes"} /-->
<!-- wp:omniform/select-option {"fieldLabel":"' . esc_html__( 'Yes', 'omniform' ) . '"} /-->
<!-- /wp:omniform/select -->
<!-- /wp:omniform/field -->

<!-- wp:omniform/fieldset {"fieldLabel":"Please rate our website","fieldName":"please-rate-our-website","style":{"spacing":{"blockGap":"0.75em"}}} -->
<!-- wp:omniform/field {"fieldLabel":"1 - Very Bad","fieldName":"1-very-bad","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/fieldset {"fieldLabel":"' . esc_html__( 'Please rate our website', 'omniform' ) . '","fieldName":"' . esc_attr__( 'please-rate-our-website', 'omniform' ) . '","style":{"spacing":{"blockGap":"0.75em"}}} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( '1 - Very Bad', 'omniform' ) . '","fieldName":"' . esc_attr__( '1-very-bad', 'omniform' ) . '","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/input {"fieldType":"radio"} /-->

<!-- wp:omniform/label /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"2 - Poor","fieldName":"2-poor","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( '2 - Poor', 'omniform' ) . '","fieldName":"' . esc_attr__( '2-poor', 'omniform' ) . '","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/input {"fieldType":"radio"} /-->

<!-- wp:omniform/label /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"3 - Average","fieldName":"3-average","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( '3 - Average', 'omniform' ) . '","fieldName":"' . esc_attr__( '3-average', 'omniform' ) . '","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/input {"fieldType":"radio"} /-->

<!-- wp:omniform/label /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"4 - Good","fieldName":"4-good","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( '4 - Good', 'omniform' ) . '","fieldName":"' . esc_attr__( '4-good', 'omniform' ) . '","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/input {"fieldType":"radio"} /-->

<!-- wp:omniform/label /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/field {"fieldLabel":"5 - Excellent","fieldName":"5-excellent","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( '5 - Excellent', 'omniform' ) . '","fieldName":"' . esc_attr__( '5-excellent', 'omniform' ) . '","layout":{"type":"flex","orientation":"horizontal","justifyContent":"left"}} -->
<!-- wp:omniform/input {"fieldType":"radio"} /-->

<!-- wp:omniform/label /-->
<!-- /wp:omniform/field -->
<!-- /wp:omniform/fieldset -->

<!-- wp:omniform/field {"fieldLabel":"How could we improve?","fieldName":"how-could-we-improve"} -->
<!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'How could we improve?', 'omniform' ) . '","fieldName":"' . esc_attr__( 'how-could-we-improve', 'omniform' ) . '"} -->
<!-- wp:omniform/label /-->

<!-- wp:omniform/textarea {"style":{"dimensions":{"minHeight":"230px"}}} /-->
<!-- /wp:omniform/field -->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:omniform/button {"buttonType":"submit","buttonLabel":"Send Feedback"} /--></div>
<div class="wp-block-group"><!-- wp:omniform/button {"buttonType":"submit","buttonLabel":"' . esc_html__( 'Send Feedback', 'omniform' ) . '"} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
',
Expand Down
10 changes: 5 additions & 5 deletions includes/BlockLibrary/BlockPatterns/newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<div class="wp-block-group has-border-color has-contrast-border-color has-foreground-color has-text-color" style="border-width:3px;border-radius:8px;padding-top:2em;padding-right:2em;padding-bottom:2em;padding-left:2em"><!-- wp:columns {"isStackedOnMobile":false} -->
<div class="wp-block-columns is-not-stacked-on-mobile"><!-- wp:column {"verticalAlignment":"top","width":"80%","style":{"spacing":{"blockGap":"0.75em"}}} -->
<div class="wp-block-column is-vertically-aligned-top" style="flex-basis:80%"><!-- wp:heading {"level":4,"style":{"typography":{"lineHeight":"1"}}} -->
<h4 class="wp-block-heading" style="line-height:1"><strong>Stay up to date</strong></h4>
<h4 class="wp-block-heading" style="line-height:1"><strong>' . esc_html__( 'Stay up to date', 'omniform' ) . '</strong></h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Get notified when I publish something new, and unsubscribe at any time.</p>
<p>' . esc_html__( 'Get notified when I publish something new, and unsubscribe at any time.', 'omniform' ) . '</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->

Expand All @@ -26,11 +26,11 @@
<!-- /wp:columns -->

<!-- wp:group {"style":{"spacing":{"blockGap":"1em"}},"layout":{"type":"flex","flexWrap":"wrap","verticalAlignment":"center"}} -->
<div class="wp-block-group"><!-- wp:omniform/field {"fieldLabel":"Your email address","fieldName":"your-email-address","isRequired":true,"style":{"layout":{"selfStretch":"fill"}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"stretch","verticalAlignment":"center"}} -->
<!-- wp:omniform/input {"fieldType":"email","fieldPlaceholder":"Your email address","style":{"spacing":{"padding":{"top":"0.72em","right":"0.72em","bottom":"0.72em","left":"0.72em"}}}} /-->
<div class="wp-block-group"><!-- wp:omniform/field {"fieldLabel":"' . esc_html__( 'Your email address', 'omniform' ) . '","fieldName":"' . esc_attr__( 'your-email-address', 'omniform' ) . '","isRequired":true,"style":{"layout":{"selfStretch":"fill"}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"stretch","verticalAlignment":"center"}} -->
<!-- wp:omniform/input {"fieldType":"email","fieldPlaceholder":"' . esc_attr__( 'Your email address', 'omniform' ) . '","style":{"spacing":{"padding":{"top":"0.72em","right":"0.72em","bottom":"0.72em","left":"0.72em"}}}} /-->
<!-- /wp:omniform/field -->

<!-- wp:omniform/button {"buttonType":"submit","buttonLabel":"Join","className":"is-style-fill"} /--></div>
<!-- wp:omniform/button {"buttonType":"submit","buttonLabel":"' . esc_html__( 'Join', 'omniform' ) . '","className":"is-style-fill"} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
',
Expand Down
Loading