from qtpy import QtCore

from prettyqt.utils import bidict

Loc = QtCore.QLocale

COUNTRY = bidict(
    any=Loc.AnyCountry,
    afghanistan=Loc.Afghanistan,
    aland_islands=Loc.AlandIslands,
    albania=Loc.Albania,
    algeria=Loc.Algeria,
    american_samoa=Loc.AmericanSamoa,
    andorra=Loc.Andorra,
    angola=Loc.Angola,
    anguilla=Loc.Anguilla,
    antarctica=Loc.Antarctica,
    antigua_and_barbuda=Loc.AntiguaAndBarbuda,
    argentina=Loc.Argentina,
    armenia=Loc.Armenia,
    aruba=Loc.Aruba,
    ascension_island=Loc.AscensionIsland,
    australia=Loc.Australia,
    austria=Loc.Austria,
    azerbaijan=Loc.Azerbaijan,
    bahamas=Loc.Bahamas,
    bahrain=Loc.Bahrain,
    bangladesh=Loc.Bangladesh,
    barbados=Loc.Barbados,
    belarus=Loc.Belarus,
    belgium=Loc.Belgium,
    belize=Loc.Belize,
    benin=Loc.Benin,
    bermuda=Loc.Bermuda,
    bhutan=Loc.Bhutan,
    bolivia=Loc.Bolivia,
    bonaire=Loc.Bonaire,
    bosnia_and_herzegowina=Loc.BosniaAndHerzegowina,
    botswana=Loc.Botswana,
    bouvet_island=Loc.BouvetIsland,
    brazil=Loc.Brazil,
    british_indian_ocean_territory=Loc.BritishIndianOceanTerritory,
    british_virgin_islands=Loc.BritishVirginIslands,
    brunei=Loc.Brunei,
    bulgaria=Loc.Bulgaria,
    burkina_faso=Loc.BurkinaFaso,
    burundi=Loc.Burundi,
    cambodia=Loc.Cambodia,
    cameroon=Loc.Cameroon,
    canada=Loc.Canada,
    canary_islands=Loc.CanaryIslands,
    cape_verde=Loc.CapeVerde,
    cayman_islands=Loc.CaymanIslands,
    central_african_republic=Loc.CentralAfricanRepublic,
    ceuta_and_melilla=Loc.CeutaAndMelilla,
    chad=Loc.Chad,
    chile=Loc.Chile,
    china=Loc.China,
    christmas_island=Loc.ChristmasIsland,
    clipperton_island=Loc.ClippertonIsland,
    cocos_islands=Loc.CocosIslands,
    colombia=Loc.Colombia,
    comoros=Loc.Comoros,
    congo_brazzaville=Loc.CongoBrazzaville,
    congo_kinshasa=Loc.CongoKinshasa,
    cook_islands=Loc.CookIslands,
    costa_rica=Loc.CostaRica,
    croatia=Loc.Croatia,
    cuba=Loc.Cuba,
    curasao=Loc.CuraSao,
    cyprus=Loc.Cyprus,
    czech_republic=Loc.CzechRepublic,
    denmark=Loc.Denmark,
    diego_garcia=Loc.DiegoGarcia,
    djibouti=Loc.Djibouti,
    dominica=Loc.Dominica,
    dominican_republic=Loc.DominicanRepublic,
    east_timor=Loc.EastTimor,
    ecuador=Loc.Ecuador,
    egypt=Loc.Egypt,
    el_salvador=Loc.ElSalvador,
    equatorial_guinea=Loc.EquatorialGuinea,
    eritrea=Loc.Eritrea,
    estonia=Loc.Estonia,
    ethiopia=Loc.Ethiopia,
    european_union=Loc.EuropeanUnion,
    europe=Loc.Europe,
    falkland_islands=Loc.FalklandIslands,
    faroe_islands=Loc.FaroeIslands,
    fiji=Loc.Fiji,
    finland=Loc.Finland,
    france=Loc.France,
    french_guiana=Loc.FrenchGuiana,
    french_polynesia=Loc.FrenchPolynesia,
    french_southern_territories=Loc.FrenchSouthernTerritories,
    gabon=Loc.Gabon,
    gambia=Loc.Gambia,
    georgia=Loc.Georgia,
    germany=Loc.Germany,
    ghana=Loc.Ghana,
    gibraltar=Loc.Gibraltar,
    greece=Loc.Greece,
    greenland=Loc.Greenland,
    grenada=Loc.Grenada,
    guadeloupe=Loc.Guadeloupe,
    guam=Loc.Guam,
    guatemala=Loc.Guatemala,
    guernsey=Loc.Guernsey,
    guinea=Loc.Guinea,
    guineabissau=Loc.GuineaBissau,
    guyana=Loc.Guyana,
    haiti=Loc.Haiti,
    heard_and_mcdonald_islands=Loc.HeardAndMcDonaldIslands,
    honduras=Loc.Honduras,
    hongkong=Loc.HongKong,
    hungary=Loc.Hungary,
    iceland=Loc.Iceland,
    india=Loc.India,
    indonesia=Loc.Indonesia,
    iran=Loc.Iran,
    iraq=Loc.Iraq,
    ireland=Loc.Ireland,
    isle_of_man=Loc.IsleOfMan,
    israel=Loc.Israel,
    italy=Loc.Italy,
    ivory_coast=Loc.IvoryCoast,
    jamaica=Loc.Jamaica,
    japan=Loc.Japan,
    jersey=Loc.Jersey,
    jordan=Loc.Jordan,
    kazakhstan=Loc.Kazakhstan,
    kenya=Loc.Kenya,
    kiribati=Loc.Kiribati,
    kosovo=Loc.Kosovo,
    kuwait=Loc.Kuwait,
    kyrgyzstan=Loc.Kyrgyzstan,
    laos=Loc.Laos,
    latin_america=Loc.LatinAmerica,
    latvia=Loc.Latvia,
    lebanon=Loc.Lebanon,
    lesotho=Loc.Lesotho,
    liberia=Loc.Liberia,
    libya=Loc.Libya,
    liechtenstein=Loc.Liechtenstein,
    lithuania=Loc.Lithuania,
    luxembourg=Loc.Luxembourg,
    macau=Loc.Macau,
    macedonia=Loc.Macedonia,
    madagascar=Loc.Madagascar,
    malawi=Loc.Malawi,
    malaysia=Loc.Malaysia,
    maldives=Loc.Maldives,
    mali=Loc.Mali,
    malta=Loc.Malta,
    marshall_islands=Loc.MarshallIslands,
    martinique=Loc.Martinique,
    mauritania=Loc.Mauritania,
    mauritius=Loc.Mauritius,
    mayotte=Loc.Mayotte,
    mexico=Loc.Mexico,
    micronesia=Loc.Micronesia,
    moldova=Loc.Moldova,
    monaco=Loc.Monaco,
    mongolia=Loc.Mongolia,
    montenegro=Loc.Montenegro,
    montserrat=Loc.Montserrat,
    morocco=Loc.Morocco,
    mozambique=Loc.Mozambique,
    myanmar=Loc.Myanmar,
    namibia=Loc.Namibia,
    nauru_country=Loc.NauruCountry,
    nepal=Loc.Nepal,
    netherlands=Loc.Netherlands,
    new_caledonia=Loc.NewCaledonia,
    new_zealand=Loc.NewZealand,
    nicaragua=Loc.Nicaragua,
    niger=Loc.Niger,
    nigeria=Loc.Nigeria,
    niue=Loc.Niue,
    norfolk_island=Loc.NorfolkIsland,
    northern_mariana_islands=Loc.NorthernMarianaIslands,
    north_korea=Loc.NorthKorea,
    norway=Loc.Norway,
    oman=Loc.Oman,
    outlying_oceania=Loc.OutlyingOceania,
    pakistan=Loc.Pakistan,
    palau=Loc.Palau,
    palestinian_territories=Loc.PalestinianTerritories,
    panama=Loc.Panama,
    papua_new_guinea=Loc.PapuaNewGuinea,
    paraguay=Loc.Paraguay,
    peru=Loc.Peru,
    philippines=Loc.Philippines,
    pitcairn=Loc.Pitcairn,
    poland=Loc.Poland,
    portugal=Loc.Portugal,
    puertorico=Loc.PuertoRico,
    qatar=Loc.Qatar,
    reunion=Loc.Reunion,
    romania=Loc.Romania,
    russia=Loc.Russia,
    rwanda=Loc.Rwanda,
    saint_barthelemy=Loc.SaintBarthelemy,
    saint_helena=Loc.SaintHelena,
    saint_kitts_and_nevis=Loc.SaintKittsAndNevis,
    saint_lucia=Loc.SaintLucia,
    saint_martin=Loc.SaintMartin,
    saint_pierre_and_miquelon=Loc.SaintPierreAndMiquelon,
    saint_vincent_and_the_grenadines=Loc.SaintVincentAndTheGrenadines,
    samoa=Loc.Samoa,
    san_marino=Loc.SanMarino,
    sao_tome_and_principe=Loc.SaoTomeAndPrincipe,
    saudi_arabia=Loc.SaudiArabia,
    senegal=Loc.Senegal,
    serbia=Loc.Serbia,
    seychelles=Loc.Seychelles,
    sierra_leone=Loc.SierraLeone,
    singapore=Loc.Singapore,
    sint_maarten=Loc.SintMaarten,
    slovakia=Loc.Slovakia,
    slovenia=Loc.Slovenia,
    solomon_islands=Loc.SolomonIslands,
    somalia=Loc.Somalia,
    south_africa=Loc.SouthAfrica,
    south_georgia_and_south_sandwich_islands=Loc.SouthGeorgiaAndTheSouthSandwichIslands,
    south_korea=Loc.SouthKorea,
    south_sudan=Loc.SouthSudan,
    spain=Loc.Spain,
    sri_lanka=Loc.SriLanka,
    sudan=Loc.Sudan,
    suriname=Loc.Suriname,
    svalbard_and_jan_mayen_islands=Loc.SvalbardAndJanMayenIslands,
    swaziland=Loc.Swaziland,
    sweden=Loc.Sweden,
    switzerland=Loc.Switzerland,
    syria=Loc.Syria,
    taiwan=Loc.Taiwan,
    tajikistan=Loc.Tajikistan,
    tanzania=Loc.Tanzania,
    thailand=Loc.Thailand,
    togo=Loc.Togo,
    tokelau_country=Loc.TokelauCountry,
    tonga=Loc.Tonga,
    trinidad_and_tobago=Loc.TrinidadAndTobago,
    tristan_da_cunha=Loc.TristanDaCunha,
    tunisia=Loc.Tunisia,
    turkey=Loc.Turkey,
    turkmenistan=Loc.Turkmenistan,
    turks_and_caicos_islands=Loc.TurksAndCaicosIslands,
    tuvalu_country=Loc.TuvaluCountry,
    uganda=Loc.Uganda,
    ukraine=Loc.Ukraine,
    united_arabemirates=Loc.UnitedArabEmirates,
    united_kingdom=Loc.UnitedKingdom,
    united_states=Loc.UnitedStates,
    united_states_minor_outlying_islands=Loc.UnitedStatesMinorOutlyingIslands,
    united_states_virgin_islands=Loc.UnitedStatesVirginIslands,
    uruguay=Loc.Uruguay,
    uzbekistan=Loc.Uzbekistan,
    vanuatu=Loc.Vanuatu,
    vatican_city_state=Loc.VaticanCityState,
    venezuela=Loc.Venezuela,
    vietnam=Loc.Vietnam,
    wallis_and_futuna_islands=Loc.WallisAndFutunaIslands,
    western_sahara=Loc.WesternSahara,
    world=Loc.World,
    yemen=Loc.Yemen,
    zambia=Loc.Zambia,
    zimbabwe=Loc.Zimbabwe,
)


class Locale(QtCore.QLocale):
    def __repr__(self):
        return f"{type(self).__name__}({self.bcp47Name()!r})"

    def __reduce__(self):
        return self.__class__, (self.bcp47Name(),)


if __name__ == "__main__":
    locale = Locale()
    print(repr(locale))
