• Resolved richardthai

    (@richardthai)


    The Falang plugin was always working well and now on my websites it starting throwing and error:
    Fatal error: Uncaught Error: Undefined constant “ICL_LANGUAGE_CODE
    When I disable the Falang plugin the site works as normal.
    What could be the problem now and suggestions of how to fix?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author sbouey

    (@sbouey)

    What are the languages you are using ? you have this in backend or front-end ?

    Plugin Author sbouey

    (@sbouey)

    you says on my websites ? you have this on several sites ?

    Plugin Author sbouey

    (@sbouey)

    When i look on google ICL_LANGUAGE_CODE is a WPML problem

    Falang read the wpml-config.xml file to translate string perhaps it’s the problem

    Thread Starter richardthai

    (@richardthai)

    I have a couple of real estate websites. One uses the Houzez theme and the other uses Residence wordpress theme. Both were working well with your plugin for a long time. I only have your plugin installed and never used WPML. The theme developers may have put code in the script to make it compatible with WPML.
    The error code pointed to this below in the theme script:

         if (function_exists(‘icl_translate’)) {

                        if (ICL_LANGUAGE_CODE != ‘en’) {

                            $handle = “bootstrap-datepicker.” . ICL_LANGUAGE_CODE;

                            $name = “bootstrap-datepicker.” . ICL_LANGUAGE_CODE . “.min.js”;

                            wp_enqueue_script($handle, HOUZEZ_JS_DIR_URI . ‘vendors/locales/’ . $name, array(‘jquery’), ‘1.0’, true);

                        }

                        $houzez_date_language = ICL_LANGUAGE_CODE;

                    }

                }

    Thread Starter richardthai

    (@richardthai)

    I have 2 real estate websites and one uses the Houzez theme and the other Residence wordpress real estate theme. They both were working for a long time and then one of the updates made them start with errors. I only use your language plugin and never installed WPML. I think maybe the theme developers added code to make the themes compatible with the WPML plugin and that may be causing the problems.
    Here is a link to a page that throws the error: https://thailandluxuryhomes.com/property/luxury-condominium-for-sale-north-hua-hin-cha-am/

    Thread Starter richardthai

    (@richardthai)

    Here is some of the code that the error points to:
    $handle = “bootstrap-datepicker.” . ICL_LANGUAGE_CODE;

                            $name = “bootstrap-datepicker.” . ICL_LANGUAGE_CODE . “.min.js”;

    ? ? ? ? ? ? ? ? ? ? ? ? wp_enqueue_script($handle, HOUZEZ_JS_DIR_URI . ‘vendors/locales/’ . $name, array(‘jquery’), ‘1.0’, true)

                        $houzez_date_language = ICL_LANGUAGE_CODE;

    Plugin Author sbouey

    (@sbouey)

    The theme houzez is a free theme ? to test it locally

    Thread Starter richardthai

    (@richardthai)

    The theme is a paid theme from Themeforest I purchased from there several years ago. They have done many updates and added functions to be compatible with WPML from what I saw in the changelog. That probably created the problem with your plugin as it always worked perfectly.

    Thread Starter richardthai

    (@richardthai)

    I removed the code the theme developer added for the WPML option and now your plugin works good again. The problem was due to the theme developer adding code just for the use of the WPML plugin. So everything is resolved and working again until possibly another theme update. I plan to keep using your good plugin as it works very well.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.