• M. NASRI

    (@mohammednasri)


    Hello,

    I updated CF7 from version 5.6.4 to 7.5.2 and the filter wpcf7_form_tag_data_option stopped doing localization. Here is the code :

    add_filter('wpcf7_form_tag_data_option', function($data, $options, $args) {
        $data = [];
    ....
                $data[] = __('Programme choisi', '...');
    ...

    This is working well with the version 5.6.4 but no more with 7.5.2.

    Could you help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Where can we see the website in question?

    Thread Starter M. NASRI

    (@mohammednasri)

    Here it is: http://cu.dev.xweb.ma/

    Thanks.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    See Editing form template

    What content do you have in the Form tab panel?

    Thread Starter M. NASRI

    (@mohammednasri)

    Here is what I have :

    
      <div class="row">
        <div class="col-md-12">[select* programmechoisi class:form-select class:form-control  first_as_label data:parcours]
        </div>
      </div>
    Plugin Author Takayuki Miyoshi

    (@takayukister)

    OK. So, what did you want to do with the data:parcours option?

    Thread Starter M. NASRI

    (@mohammednasri)

    
    add_filter('wpcf7_form_tag_data_option', function($data, $options, $args) {
        $data = [];
    
        foreach ($options as $option) {
            
            if ($option === 'parcours') {
                $data = [];
                $data[] = __("Programme choisi", "cutheme");
                $data = get_parcours_with_programmes($data);
            }

    The line : __(“Programme choisi”, “cutheme”); is not getting the translated text when I move to the new version of CF7. It is currently working well, my form shows ‘Selected programs’. But as soon as I update the plugin, the same form shows : ‘Programme choisi’.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    The translation domain is cutheme. It has nothing to do with Contact Form 7.

    Thread Starter M. NASRI

    (@mohammednasri)

    This is not the question. Yes, the translation domain is indeed cutheme and the translations are well defined. But the function __() is not working here, my question is WHY. It is working well here https://collegeuniversel.ca/en/studying-in-montreal/ where I use CF7 version 5.6.4.

    The same project (in dev mode) is hosted here : http://cu.dev.xweb.ma/en/studying-in-montreal/ with CF7 version 5.7.2.

    You will notice from the latest page that both the dynamic selects are not translated; the countries and the selected programs.

    The only different thing between the two project is the version of CF7. When I update CF7 to the current version (5.7.2), the dynamic selects show options in the original default language (French in my case), as though the WP function __() is not working.

    I hope that it is now clearer.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Localization with 7.5.2 version’ is closed to new replies.