This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

فرم تماس 7 ماژول Polylang

توضیحات

NOTE v2 is now an extension of the CF7 Smart Grid-layout plugin. You need to install it to use this plugin. Why is this? You can read this thread, and this post.
This plugin allows multilingual contact form 7 management using the polylang plugin. As of version 2.0 of this plugin, it is now developed as an extension of the CF7 Smart Grid-layout plugin. All 3 plugins, Polylang, CF7 Smart Grid-layout and Contact Form 7 need to be installed prior to installing this plugin. Works with multisite installations too.

  • اکنون می توانید از یک کد کوتاه فرم CF7 برای همه ترجمه های خود استفاده کنید.
  • WARNING: ensure you follow the installation instructions along with the PolyLang settings adjustments.

فرم CF7 خود را قابل حمل تر کنید

this plugin introduces form keys (which you can modify in the CF7 admin table). Keys are unique for each form, allowing you identify a form my its key rather than an ID. Why is this priceless? IDs changes from one server to the next because they are the custom post ID attributed by the WordPress installation, and therefore you develop your form in a local machine only to find out that the IDs are different when you move your form to your production server. To overcome this problem, we suggest you use a form key along with this plugin’s contact form shortcode, [cf7-form key="contact-us"]. Don’t worry your old contact form 7 shortcodes will still work too, behind the scenes we simply map the key to the ID and call the regular contact form 7 shortcode.

به طور مشابه می توانید از هر کد کوتاه فرم ترجمه شده استفاده کنید و افزونه اطمینان حاصل می کند که زبان مناسب بارگذاری شده است.

لطفاً دستورالعمل‌های نصب را به دقت دنبال کنید، به‌ویژه قسمت مربوط به ذخیره تنظیمات Polylang خود را پس از فعال‌سازی این افزونه.

ویدیو با زیرنویس انگلیسی در یوتیوب، اسپانیایی & فرانسوی زیرنویس در تنظیمات زیرنویس موجود است.

سایر افزونه های افزونه CF7 ما را بررسی کنید

  • ماژول CF7 Polylang – این افزونه به شما امکان می دهد تا فرم هایی را به زبان های مختلف برای یک وب سایت چند زبانه ایجاد کنید. این افزونه برای مدیریت ترجمه‌ها نیاز به نصب افزونه Polylang دارد.

  • ماژول چند اسلایدی CF7 – این افزونه به شما امکان می دهد با استفاده از یک نوار لغزنده یک فرم چند مرحله ای بسازید. هر اسلاید دارای فرم cf7 است که به هم پیوند داده شده و به صورت یک فرم ارسال می شود.

  • Post My CF7 Form – این افزونه به شما امکان می دهد فرم های ارسالی cf7 را در یک پست سفارشی ذخیره کنید ، زمینه های خود را به زمینه های متا یا طبقه بندی نقشه برداری کنید. همچنین به شما امکان می دهد قبل از نمایش فرم خود، فیلدها را از قبل پر کنید.

  • CF7 نقشه گوگل – به نقشه های گوگل اجازه می دهد تا در فرم تماس 7 درج شوند. برخلاف سایر افزونه ها، این افزونه اجازه می دهد تنظیمات نقشه باید در سطح فرم انجام شود و نقشه های متنوعی را برای هر فرم پیکربندی می کند.

  • Smart Grid-Layout Design for CF7 – allows responsive grid layout Contact Form 7 form designs, enabling modular designs of complex forms, and rich inter-linking of your CMS data with taxonomy/posts populated dynamic dropdown fields.

با تشکر از

Gérard Mathiuet for providing a fix for PolylangPro.
Peter J. Herrel for improving the language folder management.
Didier (@swissspaceboy) for pointing out an issue with the CF7 Special Mail tag [_site_url].

Privacy Notices

This plugin, in itself, does not:

  • track users by stealth;
  • write any user personal data to the database;
  • send any data to external servers;
  • use cookies.

2.5.0

  • introduce ‘cf7pll_sync_form_metakeys’ to filter the synchronised form metakeys between translations.
  • improve translation sync from original post.

2.4.1

  • fix language update.
  • add notice to post-new pages.

2.4.0

  • enable other plugins to add their translation files.
  • added ‘cf7pll_load_plugin_translation_resource’ filter.

2.3.4

  • fix broken translations of new form templates.

2.3.3

  • fix ZipArchive class missing Fatal error for PHP 7.3 onwards.

2.3.2

  • fix continue warning.

2.3.1

  • clean up deprecated delete posts code.

2.3.0

  • added hidden field _wpcf7_lang to front-end form.
  • instroduce special mail tag [_home_url].

2.2.0

  • fix for CF7 bug on special mail tag _site_url.

2.1.1

  • fix notices.
  • improved translations

2.1.0

  • allows plugin update without cf7 smart grid, but restricted functionality.

2.0.1

  • removed empty front-end css/js from script queue.

2.0.0

  • major update to plugin to integrate with WP std admin pages for cf7 offered by cf7 smart grid plugin.
  • code update to fix issue with polylang v2.3+ changes.

عکس‌های صفحه

  • اگر پیوندهای polylang را در لیست جدول مخاطبین خود نمی بینید، به تنظیمات Polylang بروید و محتوای پست موجود را به زبان پیش فرض ذخیره کنید. (مرحله 6 در دستورالعمل نصب)
  • فهرست جدول فرم تماس با ستون‌های زبان Polylang، فهرستی از زبان‌های موجود در کنار دکمه «افزودن جدید» به شما امکان می‌دهد فرم‌های جدیدی را به هر زبانی ایجاد کنید، همچنین به کدهای کوتاه cf7 قابل حمل نیز توجه کنید.
  • ایجاد فرم ترجمه جدید، با گزینه های متاباکس زبان چند زبانه.
  • Ensure you enable translations for Contact Forms in your Polyland settings.

نصب

  1. Download and install the PolyLang plugin, the CF7 Smart Grid-Layout Extension and Contact Form 7 plugins. Activate all 3 plugins.
  2. افزونه ماژول فرم تماس 7 Polylang را دانلود و نصب کنید و آن را فعال کنید.
  3. افزونه را از طریق منوی ‘افزونه ها’ در وردپرس فعال کنید
  4. پس از فعال شدن، صفحه تنظیمات Polylang، زبان‌ها->تنظیمات را در داشبورد مدیریت خود باز کنید.
  5. اگر قبلاً فرم‌های تماس ایجاد کرده‌اید، صفحه تنظیمات Polylang باید به شما اطلاع دهد که محتوایی وجود دارد که باید به زبان پیش‌فرض اختصاص داده شود. روی پیوند کلیک کنید، با این کار تمام فرم های تماس فعلی شما به زبان پیش فرضی که در تنظیمات Polylang خود انتخاب کرده اید اختصاص می دهد.
  6. اکنون لیست جدول فرم تماس را باز کنید و باید ببینید که ستون های زبان چند زبانه به جدول فرم شما اضافه شده است. می‌توانید فرم‌ها را ویرایش کنید و تکلیف زبان آن‌ها را تغییر دهید، و همچنین فرم‌های ترجمه‌شده را به هم مرتبط کنید.

سوالات متداول

1. My new forms are not translated in my language

اگر متوجه شدید که افزونه را به درستی نصب کرده‌اید و می‌توانید فرم‌های خود را با استفاده از ستون‌های زبان چند زبانه مدیریت کنید، احتمالاً زبانی که انتخاب کرده‌اید ترجمه‌ای برای فرم تماس 7 ندارد. می‌توانید به آدرس زیر مراجعه کنید. صفحه پروژه ترجمه برای مشاهده وضعیت ترجمه CF7 برای زبان خود.

2. Contact Form 7 is translated in my language, but does not load

If you have checked the above linked page and are able to find your language, then you can download your language translation pack manually. It is possible that there is mismatch between the local code used by Polylang and that assigned to your language pack.
Open the translation page for your specific language (click on the language row in this table). This will open the locale specific page that you have selected, then click on the ‘Stable’ link in the table. You should now see a page with a table that show the different translations, scroll to the bottom of the page and selected the Export format from the 2nd dropdown to ‘Machine Object .mo’, then click the Export link. This will download a zip flie. Extract the content of this file in the wp-content/languages/plugins/contact-form-7/ folder (create it if it does not exists, this folder is never updated by plugin updates). Rename file name so that the locale of the file matches the locale of your language as defined by Polylang. When you create a new form in your language you will find the polylang locale code in the url attributes of your browser address bar. So if your locale is tk_TK, and you have dowloaded and extracted a file called contact-form-7-tk.mo, rename it to contact-form-7-tk_TK.mo. This will ensure the correct file is picked.

3. My forms are only partially translated

This is because the translation in your language have not be completed. You can help the community by completing the translation online. You will need to sign up for an account if you haven’t got one already and login. You can also complete the translation on your computer by following the above procedure to download the current status of your language translation. Instead of the ‘Machine Object .mo’ format, select the ‘Portable Object .po’ format. Extract the file from the zip archive your download and edit the file using the PoEdit(or). You can then save your translation in the ‘Machine Object format’ and follow the remaining instructions above to make sure your new translation file is picked up by the plugin.

4. I want to display my forms in templates using do_shortcode()

In order to ensure the correct translation is shown in your template page, you need to make sure you get the translated id $trans_form_id in your do_shortcode function call,

do_shortcode([contact_form_7 id="{$trans_form_id}"]);

You have Polylang setup using a default language and a set of additional languages. When Polylang translates a custom post (such as the wpcf7 post), it keeps track of all translations using the post ID, by pairing the primary language post ID with its corresponding translated post IDs which is what the CF7 Polylang Extension does for you.

بنابراین باید ترجمه خود را با استفاده از شناسه پست زبان اصلی جستجو کنید، برای انجام این کار باید از آن استفاده کنید توابع پلی لانگ,

$form_id = 252; //assuming this is your default language form ID
$default_lang = pll_default_language('slug');
$current_lang = pll_current_language('slug); //the current language your page is being viewed as
if($current_lang != $default_lang){
  $form_id = pll_get_post($form_id, $current_lang);
  if(empty($form_id)){ //if a translation does not exists
    $form_id = 252; //show the default form
  }
}
//display your form
echo do_shortcode('[contact-form-7 id=”'.$form_id.'″]');

5. How do I get the current language when my form is submitted?

Polylang only filters links and provides the current language function pll_current_language() for the front-end requests. Submissions are handled using admin hooks by the CF7 plugin and these do not have access to the pll functions. To overcome this limitation, v2.3 of this plugin introduced the _wpcf7_lang hidden variable which is automatically submitted. So you can find out the current language of the submission using the $_POST['_wpcf7_lang'] value.

6. How can I can show which language site the form submisison email notification is coming from?

The cf7 plugin provides a special mail tag [_site_url] which prints the site url. However, this is not one of the filtered polylang links. Therefore as of v2.3 this plugin now has the [_home_url] mail tag that you an use in your mail body and which will show the home url of site from which it was submitted from.

Alternatively, you could also construct your own special mail tag, such as [_lang] using the follwoing code in your functions.php file,

add_filter( 'wpcf7_special_mail_tags','my_cf7_mail_tag', 10,3);
function my_cf7_mail_tag($output, $name, $html ) {
  if ( '_lang' == $name ) {
    $filter = $html ? 'display' : 'raw';
    $output = $_POST['_wpcf7_lang'];
  }
  return $output;
}

7. How to load a plugin’s translation resources?

If you have a plugin which has specific translation strings used in CF7 forms, you need to tell the CF7 Polylang plugin to load the resources for the required locale. To do this use the following filter hook,

add_filter('cf7pll_load_plugin_translation_resource', 'add_translation_resource');
function add_translation_resource($plugin_translation){
  //the $plugin_translation is an array into which you need to add your plugin slug and version number.
  $plugin_translation['my-plugin-slug']=$version.
  return $plugin_translation;
}

this filter should be used by plugin developers to ensure their plugin translation resources are loaded.

نقد و بررسی‌ها

26 جولای 2021 1 پاسخ
I tested this plugin and it worked, but in the end I switched to https://wordpress.org/plugins/multilingual-contact-form-7-with-polylang/, because 1. you don´t have to install multiple plugins, but only this single one and 2. you don´t need to create a form for every language, but can simply use one for all languages and translate it with Polylang´s string translations
12 فوریه 2019 1 پاسخ
I was looking for many times for a real, fast and good working multilanguage Contact Form solution or plugin and I found this fantastic “Contact Form 7 Polylang Module”. When starting a new contact form 7, now you can select the language as desired and configured with Polylang. The form will be translated almost automatically! Super and wonderful. 🙂 Keep going the good work!!! Good job. This earns more than 5 stars.
22 نوامبر 2018 1 پاسخ
and this one doesn’t work either CF7 Smart Grid-layout! do not install this plugin (((
خواندن تمامی 11 نقد و بررسی‌

توسعه دهندگان و همکاران

“فرم تماس 7 ماژول Polylang” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کرده‌اند.

مشارکت کنندگان

“فرم تماس 7 ماژول Polylang” به 2 زبان ترجمه شده است. با تشکر از مترجمین برای همکاری و کمک‌هایشان.

ترجمه “فرم تماس 7 ماژول Polylang” به زبان شما.

علاقه‌ مند به توسعه هستید؟

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.