Skip Navigation

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

Problem:

The custom language flag cannot be set successfully.

Solution:

1- Go to WPML-> Languages-> Edit Languages
2- Add the flag with the correct dimensions and file type (png)
3- Click save

Relevant Documentation:

https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-flags/

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 11 replies, has 3 voices.

Last updated by Osama Mersal 1 year, 9 months ago.

Assisted by: Osama Mersal.

Author Posts
September 20, 2023 at 7:22 am #14426881

leeM-17

I've tried many times to upload the UAE flag for the two custom languages إنجليزيUAE and اماراتي but no matter what I try, I can't get it set up successfully

微信图片_20230920152022.png
September 20, 2023 at 7:37 am #14427105

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Thank you for contacting the support forum.
Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

Please make sure the WPML can create the flags directory in wp-content/uploads directory.
You can check the upload directory permissions and make sure it is 755.

Thanks

September 20, 2023 at 7:58 am #14427207

leeM-17

I have followed your instructions and saw the flag directory in the sg host. The last one under the flag directory is ae. custom. png, which seems different from other things. What should I do next?

微信图片_20230920155610.png
September 20, 2023 at 8:28 am #14427541

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I'm Osama from WPML forums support. I'll be glad to help you today.

Could you please check if the issue persists in a minimal environment by following these steps?

1- Deactivate all the plugins except WPML CMS.
2- Switch to a WordPress default theme like Twenty Twenty-one.
3- Go to WPML-> Languages-> Edit Languages, and upload a fresh copy of your flags.

If the issue is gone, activate them one by one to see which one is causing an interaction issue.

❌ Please backup your database before performing the above test ❌

Kindly let me know the result of the above test.

Best regards,
Osama

September 20, 2023 at 8:47 am #14427725

leeM-17

I have followed your suggestion and proceeded to the third step. After I closed all the plugins, I reset my custom language flag. After clicking Save, this error occurred. Please help me analyze the reason and find a solution

微信图片_20230920164559.png
September 20, 2023 at 8:48 am #14427753

leeM-17

Fatal error: Uncaught Error: Call to undefined method WP_Error::filter() in /home/customer/www/changyuanflex.com/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php:202 Stack trace: #0 [internal function]: WPML\FP\Fns::WPML\FP\{closure}(Object(Closure), Object(WP_Error)) #1 /home/customer/www/changyuanflex.com/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array) #2 [internal function]: WPML\FP\{closure}(Object(WP_Error)) #3 /home/customer/www/changyuanflex.com/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array) #4 /home/customer/www/changyuanflex.com/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(105): WPML\FP\{closure}(Object(WP_Error)) #5 /home/customer/www/changyuanflex.com/public_html/wp-content/plugins/sitepress-multilingual-cms/menu/edit-languages.php(1378): WPML\F in /home/customer/www/changyuanflex.com/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php on line 202

September 20, 2023 at 8:49 am #14427761

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for your update. I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed.

Your next answer will be private, which means only you and I can access it.

❌ Please backup your database and website ❌

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

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Best regards,
Osama

September 20, 2023 at 9:19 am #14427945

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for the access details. I uploaded two custom icons, and they worked correctly. (Kindly check this hidden link)

Please try to upload your flags and let me know if they work correctly. If not, please upload them to a file transfer service, like Google Drive or Mega, and send me the link to try them.

Best regards,
Osama

September 20, 2023 at 9:31 am #14428061

leeM-17

Friend, I still can't upload Peugeot for those two custom languages, forget it. I would like to upload images of the UAE flag for these two custom languages. Please help me upload them. The images are attached. نجليزي UAE and اماراتي Please upload the attached images for these two custom languages

Flag_of_the_United_Arab_Emirates.svg.png
微信图片_20230920172745.png
微信图片_20230920172656.png
September 20, 2023 at 9:41 am #14428345

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I added the flag to the languages you mentioned. (Kindly check the attached screenshot)

Best regards,

2023-09-20_12-40-06.jpg
September 20, 2023 at 9:47 am #14428395

leeM-17

I have seen it and the problem has been resolved. Thank you, my friend

September 20, 2023 at 9:48 am #14428401

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

It's great to hear that the issue is fixed 🙂 . Please don't hesitate to open a new ticket if you face any other issues. We are always happy to help you.

Have a great day!

Best regards,