How to edit the country names in the dropdown menu? - National Flags
How to edit the country names in the dropdown menu?
I've just noticed when selecting my flag that some of the country names are messed up. Some of them are in all caps with underscores, e.g. COOK_ISLANDS instead of Cook Islands, or mixed case like CURAçAO. How can I edit these to correct them?
Last edited by Bruce Banner on Thu Dec 24, 2020 4:01 pm
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: How to edit the country names in the dropdown menu?
Check the language files or Edit the Flag and change the name.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22092
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: How to edit the country names in the dropdown menu?
This is bizarre. I just checked all the language files, and they're fine, and the flag names are fine in the ACP, but in my dropdown menu in the UCP, Cocos (Keeling) Islands appears as COCOS_(KEELING)_ISLANDS_, Cook Islands appears as COOK_ISLANDS, and Curaçao appears as CURAçAO. I think it might have something to do with the fact that the list of countries in language>en>common.php is not in alphabetical order. The list appears to be in alphabetical order from Afghanistan down to Zimbabwe, but then it starts again with Cocos (Keeling) Islands, and the order from there appears to be random,RMcGirr83 wrote:Check the language files or Edit the Flag and change the name.
Code: Select all
'COCOS_(KEELING)_ISLANDS ' => 'Cocos (Keeling) Islands ',
'COOK ISLANDS' => 'Cook Islands',
'CURACAO' => 'Curaçao',
'CHRISTMAS_ISLAND' => 'Christmas Island',
'GIBRALTAR' => 'Gibraltar',
'SAINT-MARTIN_(FRENCH_PART)' => 'Saint-Martin (French part)',
'MARTINIQUE' => 'Martinique',
'NEW_CALEDONIA' => 'New Caledonia',
'NIUE' => 'Niue',
'FRENCH_POLYNESIA' => 'French Polynesia',
'SOUTH_SUDAN' => 'South Sudan',
'FRENCH_SOUTHERN_TERRITORIES' => 'French Southern Territories',
'TOKELAU' => 'Tokelau',
'WALLIS_AND_FUTUNA_ISLANDS' => 'Wallis and Futuna Islands',
'MAYOTTE' => 'Mayotte',
'SERBIA' => 'Serbia',
Also, in the ACP, the flag for Curaçao is missing. I can see it in the flags folder, where it's named cw, but here are a couple of screenshots of the ACP,
As ya can see in the second screenshot, the filename reads CW.png instead of cw.png as it should. I assume that's the reason the flag isn't showing, because ya must have unknowingly had caps lock on when ya were typing the filename. And here's a screenshot of what I can see in my UCP if I select Curaçao,
Sorry to make ya aware of all these bugs now but it just appears to me that the extension was validated too soon. I'm surprised no one else came across these before I did.
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: How to edit the country names in the dropdown menu?
'COOK ISLANDS' => 'Cook Islands',
missing an underscore, should be
'COOK_ISLANDS' => 'Cook Islands',
and to fix you can simply edit the flags and fix the lang file issues. This should have been caught in validation but it wasn't. No one is perfect.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22092
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: How to edit the country names in the dropdown menu?
OK, I added an underscore where ya'd forgotten it and I've managed to fix the name problem with Cook Islands, but I don't know what edits I need to make to fix Cocos (Keeling) Islands, or Curaçao. I experimented and changed the following line of code in language>en>common.php fromRMcGirr83 wrote:'COOK ISLANDS' => 'Cook Islands',
missing an underscore, should be
'COOK_ISLANDS' => 'Cook Islands',
and to fix you can simply edit the flags and fix the lang file issues. This should have been caught in validation but it wasn't. No one is perfect.
Code: Select all
'COCOS_(KEELING)_ISLANDS ' => 'Cocos (Keeling) Islands ',
Code: Select all
'COCOS_(KEELING)_ISLANDS_ ' => 'Cocos (Keeling) Islands ',
Code: Select all
'COCOS_(KEELING)_ISLANDS '
Code: Select all
'Cocos (Keeling) Islands '
Code: Select all
'COCOS_(KEELING)_ISLANDS ' => 'Cocos (Keeling) Islands ',
Code: Select all
'COCOS_(KEELING)_ISLANDS' => 'Cocos (Keeling) Islands',
Code: Select all
'CURACAO' => 'Curaçao',
Code: Select all
'CURAÇAO' => 'Curaçao',
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: How to edit the country names in the dropdown menu?
The curacao image is being stored in the DB as CW.png which is why it displays like that. Go into the database and in the flags table find curacao and change the flag image name to cw.png then purge the cache. As far as cocos goes, it's displaying properly for me by simply removing the extra space.
The cedilla doesn't matter, what does matter is the spelling of the name in the ACP and the spacing per this.
https://github.com/rmcgirr83/nationalfl ... hp#L55-L57
Don't know how I missed it but with 200+ flags I suppose one or two are going to be missed. I'll try and update the extension on here sometime this week for validation.
The cedilla doesn't matter, what does matter is the spelling of the name in the ACP and the spacing per this.
https://github.com/rmcgirr83/nationalfl ... hp#L55-L57
Don't know how I missed it but with 200+ flags I suppose one or two are going to be missed. I'll try and update the extension on here sometime this week for validation.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22092
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: How to edit the country names in the dropdown menu?
I don't know how to go into the database. I know how to change code in extension files and reupload them but I don't know how to "go into" the database. When ya say removing the extra space for cocos, do ya mean changing thisRMcGirr83 wrote:The curacao image is being stored in the DB as CW.png which is why it displays like that. Go into the database and in the flags table find curacao and change the flag image name to cw.png then purge the cache. As far as cocos goes, it's displaying properly for me by simply removing the extra space.
The cedilla doesn't matter, what does matter is the spelling of the name in the ACP and the spacing per this.
https://github.com/rmcgirr83/nationalfl ... hp#L55-L57
Don't know how I missed it but with 200+ flags I suppose one or two are going to be missed. I'll try and update the extension on here sometime this week for validation.
Code: Select all
'COCOS_(KEELING)_ISLANDS ' => 'Cocos (Keeling) Islands ',
Code: Select all
'COCOS_(KEELING)_ISLANDS' => 'Cocos (Keeling) Islands',
Because, if so, that's just not working for me. I've tried it several times now. I delete that space, reupload common,php, purge the cache, hard refresh the browser, go back into the UCP, pull down the dropdown menu, and it's still listed as COCOS_(KEELING)_ISLANDS_
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: How to edit the country names in the dropdown menu?
And what is the entry in the ACP for Cocos? Just wait for the next version.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22092
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: How to edit the country names in the dropdown menu?
Don't understand what ya mean. Do ya mean what's its name in the ACP? It says what it's supposed to, Cocos (Keeling) Islands. But in my UCP dropdown menu, it still shows up as COCOS_(KEELING)_ISLANDS_. I just can't figure out what the problem could be.RMcGirr83 wrote:And what is the entry in the ACP for Cocos? Just wait for the next version.
EDIT: Oh wait. I just clicked in the Flag Name box in the ACP and found there was an extra space after Islands, so I hit backspace, clicked Submit, went back to my UCP dropdown menu, and found that the third underscore is now gone, so it now says COCOS_(KEELING)_ISLANDS. I just can't figure out where the underscores are coming from and why it's in all caps. And I can't figure out CURAçAO either.
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: How to edit the country names in the dropdown menu?
Just downloaded and tested the new updated version. All the spelling errors I spotted are fixed but, unfortunately, there's still a problem with Curaçao. When you select it from the dropdown menu in the user control panel, instead of the flag, you just get the name Curaçao.
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: How to edit the country names in the dropdown menu?
Can't reproduce any of this
Is the name of the flag correct (cw.png) capitalization matters.Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22092
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: How to edit the country names in the dropdown menu?
I don't know how to explain it but there is some kind of weird bug in the extension that I can apparently only fix using Atom because I've tried fixing it using Notepad++ and it doesn't work. If I use Atom to search the extension for cura, as in Curaçao, these are the results I get,
Look at line 34 in migrations\m13_update_data.php
If you zoom in, ya'll see that, in place of the ç in Curaçao, there's a weird sorta diamond-shaped symbol with a question mark in it. If ya look at that same line of code in Notepad++, that symbol isn't there. It just says Curaçao. If I try using Notepad++ to fix the weird problem and replace the ç in Curaçao with a ç (in other words, not replace it at all but just delete and then retype it), and then I repeat the Atom search for cura, that symbol will still be there, unchanged. But if I click on it in Atom, bringing up a tab that shows that particular file, with Curaçao highlighted but with that weird symbol in place of the ç, and I delete the weird symbol and replace it with a ç, THEN the Atom search shows that I HAVE deleted the weird symbol and replaced it with a ç. If I delete the weird symbol in line 34 of m13_update_data.php OR in line 912 of m6_update_data.php, or both, and then upload and install the extension, THEN the correct Curaçao flag shows in the dropdown menu when I select Curaçao, but if all I do is just download the extension and then upload and install it unaltered, then if I select Curaçao from the dropdown menu, all I get is the word Curaçao.
Look at line 34 in migrations\m13_update_data.php
If you zoom in, ya'll see that, in place of the ç in Curaçao, there's a weird sorta diamond-shaped symbol with a question mark in it. If ya look at that same line of code in Notepad++, that symbol isn't there. It just says Curaçao. If I try using Notepad++ to fix the weird problem and replace the ç in Curaçao with a ç (in other words, not replace it at all but just delete and then retype it), and then I repeat the Atom search for cura, that symbol will still be there, unchanged. But if I click on it in Atom, bringing up a tab that shows that particular file, with Curaçao highlighted but with that weird symbol in place of the ç, and I delete the weird symbol and replace it with a ç, THEN the Atom search shows that I HAVE deleted the weird symbol and replaced it with a ç. If I delete the weird symbol in line 34 of m13_update_data.php OR in line 912 of m6_update_data.php, or both, and then upload and install the extension, THEN the correct Curaçao flag shows in the dropdown menu when I select Curaçao, but if all I do is just download the extension and then upload and install it unaltered, then if I select Curaçao from the dropdown menu, all I get is the word Curaçao.
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: How to edit the country names in the dropdown menu?
The encoding for m13_update_data is set to ANSI. That's the problem, it needs to be UTF8. Nice catch but I doubt if I'll update the extension for this. I'll see if I can get a repack on the current version.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22092
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
Re: How to edit the country names in the dropdown menu?
In your previous post, you showed that you weren't able to reproduce the problem yourself. I don't understand why. As there is indeed actually a slight issue to do with encoding, why did you not get the same problem I did, with just the word Curaçao showing in the dropdown instead of the flag?RMcGirr83 wrote:The encoding for m13_update_data is set to ANSI. That's the problem, it needs to be UTF8. Nice catch but I doubt if I'll update the extension for this. I'll see if I can get a repack on the current version.
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: How to edit the country names in the dropdown menu?
Don't know but it is what it is and that was the reason as to why you had the issue you were having. Maybe out database collations don't match but it doesn't do any good to continue. I have to submit a new version to fix this issue and will be doing so in the next coming days.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer
Appreciate the extensions/mods/support then you can support me by buying a beer
-
- Former Team Member
- Posts: 22092
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr