Skip Navigation

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

Problem:
I expected to see:

The Chinese flag provided by wpml at
https://cms.apptweak.com/app/plugins/sitepress-multilingual-cms/res/flags/zh.png

Instead, I got:
a broken image, pointing to : https://cms.apptweak.com/app/plugins/sitepress-multilingual-cms/res/flags/

Solution:
The language code will be used to locate the flag.

since the language code is zh-cn and there is no zh-cn.png flag it will be displayed as broken.

Go to /plugins/sitepress-multilingual-cms/res and in there you can duplicate the flag for zh.png and name it zh-cn.png or even rename it.

However, I'd recommend downloading it to your computer and uploading it through
WPML->Languages->edit languages -> custom flag.

This will ensure the flag remains even after plugin updates.

Relevant Documentation:
Using Custom Flags in WPML

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 topic contains 4 replies, has 2 voices.

Last updated by alexandreP-37 1 year, 11 months ago.

Assisted by: Bobby.

Author Posts
February 15, 2023 at 4:30 pm #13042281

alexandreP-37

I am trying to:

Create a custom language, based on Chinese.

Link to a page where the issue can be seen:

/wp-admin/admin.php?page=sitepress-multilingual-cms%2Fmenu%2Flanguages.php&trop=1

I expected to see:

The Chinese flag provided by wpml at
hidden link

Instead, I got:
a broken image, pointing to : hidden link

wpml-flag-bug.png
February 16, 2023 at 1:07 am #13044561

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi there,

The language code will be used to locate the flag.

since the language code is zh-cn and there is no zh-cn.png flag it will be displayed as broken.

Go to /plugins/sitepress-multilingual-cms/res and in there you can duplicate the flag for zh.png and name it zh-cn.png or even rename it.

However, I'd recommend downloading it to your computer and uploading it through
WPML->Languages->edit languages -> custom flag.

This will ensure the flag remains even after plugin updates.

Let me know your results, please.

February 16, 2023 at 8:52 am #13046543

alexandreP-37

if i upload a flag image, here is what i then see. A broken image. If i inspect the html code, i see this:

<li>
<input type="radio" id="wpm-edit-languages-67-flag-upload" name="icl_edit_languages[67][flag_upload]" value="true" class="radio icl_edit_languages_use_upload" checked="checked">
								&nbsp;
								<label for="wpm-edit-languages-67-flag-upload">
																			&nbsp;<img src="" alt="zh-cn" width="18">
																		Custom flag								</label>
								<input type="hidden" name="MAX_FILE_SIZE" value="100000">

								<div class="wpml-edit-languages-flag-upload-wrapper">
									<input type="hidden" name="icl_edit_languages[67][flag]" value="" class="icl_edit_languages_flag_enter_field" style="width: auto;">
									<input type="file" name="icl_edit_languages[67][flag_file]" class="icl_edit_languages_flag_upload_field file" style="width: 200px;">
									<br>
									(allowed: gif, jpg|jpeg|jpe, png, svg)								</div>

							</li>
wpml-flag2.png
wpml-flag.png
February 16, 2023 at 6:34 pm #13051819

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Share the flag you are uploading with me please, or upload it to the directory for me to locate it.

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby