Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
User wasn't able to switch to automatic translation thus not being able to translate anything.

There were following errors:
JS:

app.js?ver=4.6.5:425 Uncaught (in promise) TypeError: Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at app.js?ver=4.6.5:425:48217
    at c (app.js?ver=4.6.5:368:5848)
    at Generator._invoke (app.js?ver=4.6.5:368:5601)
    at Generator.next (app.js?ver=4.6.5:368:6207)
    at n (app.js?ver=4.6.5:8:5774)
    at s (app.js?ver=4.6.5:8:5985)
</anonymous>

DB error in debug log:

WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')
                   AND post_status = 'publish'
                   AND source_language_c...' at line 9 for query 
            SELECT translations.post_type, COUNT(translations.ID)
            FROM (
                SELECT RIGHT(element_type, LENGTH(element_type) - 5) as post_type, posts.ID
                FROM wp_icl_translations
                INNER JOIN wp_posts posts ON element_id = ID
                
                LEFT JOIN wp_postmeta postmeta ON postmeta.post_id = posts.ID AND postmeta.meta_key = '_wpml_post_translation_editor_native'
                                            
                WHERE element_type IN ()
                   AND post_status = 'publish'
                   AND source_language_code IS NULL
                   AND language_code = 'en'
                   AND (
                       SELECT COUNT(trid)
                       FROM wp_icl_translations icl_translations_inner
                       INNER JOIN wp_icl_translation_status icl_translations_status
                                           on icl_translations_inner.translation_id = icl_translations_status.translation_id
                       WHERE icl_translations_inner.trid = wp_icl_translations.trid
                         AND icl_translations_status.status NOT IN ('0','42')
                         AND icl_translations_status.needs_update != 1
                   ) < 18
                   AND ( postmeta.meta_value IS NULL OR postmeta.meta_value = 'no' )
             ) as translations
            GROUP BY translations.post_type;
         made by do_action('wp_ajax_wpml_action'), WP_Hook->do_action, WP_Hook->apply_filters, WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Promise->resolve, WPML\FP\Right->chain, WPML\FP\Right->map, WPML\Ajax\Factory->WPML\Ajax\{closure}, WPML\FP\Just->map, WPML\FP\{closure}, call_user_func_array, WPML\Container\Container::execute, WPML\Auryn\Injector->execute, call_user_func_array, WPML\Auryn\Executable->__invoke, ReflectionMethod->invokeArgs, WPML\Posts\UntranslatedCount->run

Solution:
Reset the Automatic Translation setting by deleting "WPML(post-type)" key from "wp_options" table.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 22 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 10 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
September 6, 2023 at 11:30 am #14351815

flutur-catalinc

plase set to shows in client broswer language when come to website
i dont find nowne to do this

September 6, 2023 at 11:31 am #14351825

flutur-catalinc

also i see now a red notice something with multicurency

September 6, 2023 at 1:23 pm #14352863

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I've fixed all the problems:

- Automatic Translation is now active.
- Notice about multicurrency has been fixed.

For the products, as I mentioned earlier, you'll need to remove from Trash permanently and then send again for translation. Check this guide about how you can do that https://wpml.org/documentation/automatic-translation/automatically-translating-multiple-translation-jobs-in-bulk/. Unfortunately, I can not do this for you, you'll have to do it on your own.

plase set to shows in client broswer language when come to website
i dont find nowne to do this

To choose their own administration language, users should go to the Users → Profile page and use the Language option in the Personal Options section. See for details https://wpml.org/documentation/getting-started-guide/language-setup/setting-the-wordpress-administration-language/.

Please note that original issue about not being able to auto-translate products has been resolved, the automatic translation has been active and now you can send products for automatic translation as advised above.

For other issues, please open separate tickets, because as per our forum policy we can only handle one issue per ticket.

September 6, 2023 at 1:49 pm #14353089

flutur-catalinc

is not a problem with the produc from trash, i alredy bringh back in all product list
i dont know how to translte the rest of the product

September 6, 2023 at 1:50 pm #14353091

flutur-catalinc

he start now to translate, i am so happy.
tks

September 6, 2023 at 1:51 pm #14353097

flutur-catalinc

i want to ask you if the language show when a buyer come to website is his native language autmatic

September 7, 2023 at 5:32 am #14355739

flutur-catalinc

i see the plugin dont translate all, for exemple the ceckout page where i write name and the adress remain in english and other pages

September 7, 2023 at 7:03 am #14356323

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the confirmation and glad automatic translation starts working now.

The other 2 are different issues, I recommend opening a separate ticket because as per forum policy we can only handle one issue per ticket. So you can get more to the point help, without mixing up several issues in one long ticket.

I'll close this ticket as resolved now.