Customization of the List of Countries in the Field Type Country of Registration Forms


#1

Hi,
How I could customize the list of countries provided by the field type country in registration forms to reflect the official list of countries of the UN???.
Thanks for your replies,
DdM


#2

Hey, so basically you could provide a CUSTOM_COUNTRIES option in your Indico config which should extend the basic list of countries we utilize. So, for example in indico.conf

CUSTOM_COUNTRIES = {'KP': 'North Korea'}

#3

Excellent! Thank you for the advice!.

What about the translations?, in this case we need to have these in English and Spanish.

Regards,

DdM


#4

as with all custom texts at the moment that’s currently not possible. as possible workaround is putting both versions in the same string, e.g. “english here / espanol here” - but of course that doesn’t look super amazing…


#5

That would be enough for us!. Thank you very much!


#6

Hi,
After placing the list of CUSTOM_COUNTRIES, I’m noticing that it doesn’t remove undesirable items in the list of countries.
Would there be a way to remove them from the list shown by the country field type?
Thanks in advance for your reply


#7

Nope, that’s not possible. I’m curious, what’s your use case for that?


#8

It’s because diplomatic reasons, our organization only recognizes UN associated countries.
Thanks for your reply.


#9

OK, interesting use case. Being able to remove countries by setting them to None in the config would be pretty easy to add. If you have a developer who’s willing to send a Pull Request for it I think it’d have good chances to get merged.

This is the relevant file that needs to be changed:


#10

Thank you again!. I’ll give it a try!.


#11

Another route worth a try is regnerating pycountry against an up-to-date (and correct) debian pkg-isocode.
See https://salsa.debian.org/iso-codes-team/iso-codes and https://bitbucket.org/flyingcircus/pycountry/src for the respective sources.

Björn


#12

Thank you Björn, definitely that is also an option!