Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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.

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

Problem: I am trying to Change the language switcher flag but it does not change.

Solution: Solution here: https://wpml.org/forums/topic/wpml-uses-only-wpml-flag-and-not-my-custom-flag/#post-4005823

This topic contains 8 replies, has 2 voices.

Last updated by ahmedC-2 5 months, 3 weeks ago.

Assigned support staff: Noman.

Author Posts
June 10, 2019 at 1:31 pm #3987697

ahmedC-2

I am trying to: Change the language flag

Link to a page where the issue can be seen: hidden link

I expected to see: My custom flag (Qatar flag to represent the Arabic language)

Instead, I got: WPML flag (which shows pakistani flag which is not Arabic)

June 10, 2019 at 3:14 pm #3988445

Noman
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML Support. Could you please try to follow below steps and let me know how it goes?

1. Upload your custom flag image to WPML >> Languages >> Edit Languages. This will upload your files, but resize them to 18x12.

2. If you want to resize flag dimensions then with FTP program, go to wp-content/uploads/flags and upload your flag images again, overwriting the flag images that were uploaded in Step #1

Thank you

June 10, 2019 at 3:52 pm #3988519

ahmedC-2

Yes, I did many times the first step and click on save but it always gets back to WPML default flag.

Thanks

June 10, 2019 at 4:52 pm #3988931

Noman
Supporter

Languages: English (English )

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

Hi,

Could you please check for a possible theme and plugin conflict. To do that you can switch back to any default theme (e.g. Twenty Seventeen theme), Disable all plugins except WPML and see if this issue goes away with default theme and only WPML activated?

If still issue persists, please enable error reporting at you site as I need to see the detail of the error log. You can see how to enable debug logging here:
https://wpml.org/documentation/support/debugging-wpml/
https://codex.wordpress.org/Debugging_in_WordPress

To enable it, open your ‘wp-config.php’ file and look for ‘define(‘WP_DEBUG’, false);’. Change it to:

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings 
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

define( 'SCRIPT_DEBUG', true );

After adding the above code please try to reproduce the issue and this will create debug.log file in your site's wp-content directory. Please send me its contents.

Thank you

June 10, 2019 at 7:21 pm #3989843

ahmedC-2

The issue still persists.
How do you want me to send the log file ?
By the way, the issue is that the language flag doesn't change.

June 11, 2019 at 6:42 am #3992153

Noman
Supporter

Languages: English (English )

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

Hi,

To further debug this issue, please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and debug the issue.

Your next answer will be private which means only you and I have access to it.

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

Thank you

June 12, 2019 at 12:55 pm #4004501

Noman
Supporter

Languages: English (English )

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

Hi,

Thanks for the login info. I am working on this issue and get back to you with my findings.

Thank you for your cooperation and patience.

June 12, 2019 at 3:31 pm #4005823

Noman
Supporter

Languages: English (English )

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

Hi,

I have enabled error reporting in your site and found below errors in wp-content/debug.log file:

[12-Jun-2019 15:07:22 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function mime_content_type() in /home/nqashatc/public_html/khetm/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php:13

You can fix this issue by enabling php_fileinfo extension (You may need to request your hosting company to do this if you don't have access to your server).

As a workaround, I have replaced below code:

$mime_type = mime_content_type( $filename );

With:

$mime_type = 'image/gif';

From sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php:13 and now custom flag working fine as you can see in the attached screenshot.

Now you can upload your custom flag from WPML >> Languages >> Edit Languages.

Please let me know if this resolves your issue or you need further assistance.

Thank you

June 16, 2019 at 7:10 pm #4031069

ahmedC-2

My issue is resolved now. Thank you!