Hauptmenü öffnen

Memory Alpha Nova β

Modul:Region

Version vom 18. Januar 2019, 21:41 Uhr von Phoenixclaw (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „local p = {} local countryNamesDe = { {"DE","Deutschland"}, {"US","USA"}, {"GB","Vereinigtes Königreich"}, {"FR","Frankreich"}, {"IT","Italien"},…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version ansehen (Unterschied) | Nächstjüngere Version → (Unterschied)

Die Dokumentation für dieses Modul kann unter Modul:Region/Doku erstellt werden

local p = {}

local countryNamesDe = {
  {"DE","Deutschland"},
  {"US","USA"},
  {"GB","Vereinigtes Königreich"},
  {"FR","Frankreich"},
  {"IT","Italien"},
  {"JP","Japan"},
  {"XW","Weltweit"},
  {"AF","Afghanistan"},
  {"EG","Ägypten"},
  {"AX","Åland"},
  {"AL","Albanien"},
  {"DZ","Algerien"},
  {"AS","Amerikanisch-Samoa"},
  {"VI","Amerikanische Jungferninseln"},
  {"AD","Andorra"},
  {"AO","Angola"},
  {"AI","Anguilla"},
  {"AQ","Antarktika"},
  {"AG","Antigua und Barbuda"},
  {"GQ","Äquatorialguinea"},
  {"AR","Argentinien"},
  {"AM","Armenien"},
  {"AW","Aruba"},
  {"AC","Ascension"},
  {"AZ","Aserbaidschan"},
  {"ET","Äthiopien"},
  {"AU","Australien"},
  {"BS","Bahamas"},
  {"BH","Bahrain"},
  {"BD","Bangladesch"},
  {"BB","Barbados"},
  {"BY","Weißrussland"},
  {"BE","Belgien"},
  {"BZ","Belize"},
  {"BJ","Benin"},
  {"BM","Bermuda"},
  {"BT","Bhutan"},
  {"BO","Bolivien"},
  {"BQ","Bonaire, Sint Eustatius und Saba (Niederlande)"},
  {"BA","Bosnien und Herzegowina"},
  {"BW","Botswana"},
  {"BV","Bouvetinsel"},
  {"BR","Brasilien"},
  {"VG","Britische Jungferninseln"},
  {"IO","Britisches Territorium im Indischen Ozean"},
  {"BN","Brunei Darussalam"},
  {"BG","Bulgarien"},
  {"BF","Burkina Faso"},
  {"BU","Burma"},
  {"BI","Burundi"},
  {"EA","Ceuta"},
  {"CL","Chile"},
  {"CN","Volksrepublik China"},
  {"CP","Clipperton"},
  {"CK","Cookinseln"},
  {"CR","Costa Rica"},
  {"CI","Elfenbeinküste"},
  {"CW","Curaçao"},
  {"DK","Dänemark"},
  {"DD","Deutsche Demokratische Republik"},
  {"DG","Diego Garcia"},
  {"DM","Dominica"},
  {"DO","Dominikanische Republik"},
  {"DJ","Dschibuti"},
  {"EC","Ecuador"},
  {"SV","El Salvador"},
  {"ER","Eritrea"},
  {"EE","Estland"},
  {"CE","Europäische Gemeinschaft"},
  {"EU","Europäische Union"},
  {"FK","Falklandinseln"},
  {"FO","Färöer"},
  {"FJ","Fidschi"},
  {"FI","Finnland"},
  {"FX","France métropolitaine"},
  {"GF","Französisch-Guayana"},
  {"PF","Französisch-Polynesien"},
  {"TF","Französische Süd- und Antarktisgebiete"},
  {"GA","Gabun"},
  {"GM","Gambia"},
  {"GE","Georgien"},
  {"GH","Ghana"},
  {"GI","Gibraltar"},
  {"GD","Grenada"},
  {"GR","Griechenland"},
  {"GL","Grönland"},
  {"GP","Guadeloupe"},
  {"GU","Guam"},
  {"GT","Guatemala"},
  {"GG","Guernsey (Kanalinsel)"},
  {"GN","Guinea"},
  {"GW","Guinea-Bissau"},
  {"GY","Guyana"},
  {"HT","Haiti"},
  {"HM","Heard und McDonaldinseln"},
  {"HN","Honduras"},
  {"HK","Hongkong"},
  {"IN","Indien"},
  {"ID","Indonesien"},
  {"IM","Insel Man"},
  {"IQ","Irak"},
  {"IR","Iran"},
  {"IE","Irland"},
  {"IS","Island"},
  {"IL","Israel"},
  {"JM","Jamaika"},
  {"YE","Jemen"},
  {"JE","Jersey (Kanalinsel)"},
  {"JO","Jordanien"},
  {"YU","Jugoslawien"},
  {"KY","Kaimaninseln"},
  {"KH","Kambodscha"},
  {"CM","Kamerun"},
  {"CA","Kanada"},
  {"IC","Kanarische Inseln"},
  {"CV","Kap Verde"},
  {"KZ","Kasachstan"},
  {"QA","Katar"},
  {"KE","Kenia"},
  {"KG","Kirgisistan"},
  {"KI","Kiribati"},
  {"CC","Kokosinseln"},
  {"CO","Kolumbien"},
  {"KM","Komoren"},
  {"CD","Zaire"},
  {"CG","Republik Kongo"},
  {"KP","Nordkorea"},
  {"KR","Südkorea"},
  {"XK","Kosovo"},
  {"HR","Kroatien"},
  {"CU","Kuba"},
  {"KW","Kuwait"},
  {"LA","Laos"},
  {"LS","Lesotho"},
  {"LV","Lettland"},
  {"LB","Libanon"},
  {"LR","Liberia"},
  {"LY","Libyen"},
  {"LI","Liechtenstein"},
  {"LT","Litauen"},
  {"LU","Luxemburg"},
  {"MO","Macau"},
  {"MG","Madagaskar"},
  {"MW","Malawi"},
  {"MY","Malaysia"},
  {"MV","Malediven"},
  {"ML","Mali"},
  {"MT","Malta"},
  {"MA","Marokko"},
  {"MH","Marshallinseln"},
  {"MQ","Martinique"},
  {"MR","Mauretanien"},
  {"MU","Mauritius"},
  {"YT","Mayotte"},
  {"MK","Mazedonien"},
  {"MX","Mexiko"},
  {"FM","Mikronesien"},
  {"MD","Moldawien"},
  {"MC","Monaco"},
  {"MN","Mongolei"},
  {"ME","Montenegro"},
  {"MS","Montserrat"},
  {"MZ","Mosambik"},
  {"MM","Myanmar"},
  {"NA","Namibia"},
  {"NR","Nauru"},
  {"NP","Nepal"},
  {"NC","Neukaledonien"},
  {"NZ","Neuseeland"},
  {"NT","Saudi-Arabien/Irak"},
  {"NI","Nicaragua"},
  {"NL","Niederlande"},
  {"AN","Niederländische Antillen"},
  {"NE","Niger"},
  {"NG","Nigeria"},
  {"NU","Niue"},
  {"MP","Nördliche Marianen"},
  {"NF","Norfolkinsel"},
  {"NO","Norwegen"},
  {"OM","Oman"},
  {"AT","Österreich"},
  {"TL","Osttimor (Timor-Leste)"},
  {"PK","Pakistan"},
  {"PS","Palastina"},
  {"PW","Palau"},
  {"PA","Panama"},
  {"PG","Papua-Neuguinea"},
  {"PY","Paraguay"},
  {"PE","Peru"},
  {"PH","Philippinen"},
  {"PN","Pitcairninseln"},
  {"PL","Polen"},
  {"PT","Portugal"},
  {"PR","Puerto Rico"},
  {"RE","Réunion"},
  {"RW","Ruanda"},
  {"RO","Rumänien"},
  {"RU","Russische Föderation"},
  {"SB","Salomonen"},
  {"BL","Saint-Barthélemy"},
  {"MF","Saint-Martin (Frankreich)"},
  {"ZM","Sambia"},
  {"WS","Samoa"},
  {"SM","San Marino"},
  {"ST","São Tomé und Príncipe"},
  {"SA","Saudi-Arabien"},
  {"SE","Schweden"},
  {"CH","Schweiz"},
  {"SN","Senegal"},
  {"RS","Serbien"},
  {"CS","Serbien und Montenegro"},
  {"SC","Seychellen"},
  {"SL","Sierra Leone"},
  {"ZW","Simbabwe"},
  {"SG","Singapur"},
  {"SX","Sint Maarten (Niederlande)"},
  {"SK","Slowakei"},
  {"SI","Slowenien"},
  {"SO","Somalia"},
  {"ES","Spanien"},
  {"LK","Sri Lanka"},
  {"SH","St. Helena"},
  {"KN","St. Kitts und Nevis"},
  {"LC","St. Lucia"},
  {"PM","Saint-Pierre und Miquelon"},
  {"VC","St. Vincent und die Grenadinen"},
  {"ZA","Südafrika"},
  {"SD","Sudan"},
  {"GS","Südgeorgien und die Südlichen Sandwichinseln"},
  {"SS","Südsudan"},
  {"SR","Suriname"},
  {"SJ","Svalbard und Jan Mayen"},
  {"SZ","Swasiland"},
  {"SY","Syrien, Arabische Republik"},
  {"TJ","Tadschikistan"},
  {"TW","Taiwan"},
  {"TZ","Tansania"},
  {"TH","Thailand"},
  {"TG","Togo"},
  {"TK","Tokelau"},
  {"TO","Tonga"},
  {"TT","Trinidad und Tobago"},
  {"TA","Tristan da Cunha"},
  {"TD","Tschad"},
  {"CZ","Tschechien"},
  {"CS","Tschechoslowakei"},
  {"TN","Tunesien"},
  {"TR","Türkei"},
  {"TM","Turkmenistan"},
  {"TC","Turks- und Caicosinseln"},
  {"TV","Tuvalu"},
  {"SU","UdSSR"},
  {"UG","Uganda"},
  {"UA","Ukraine"},
  {"HU","Ungarn"},
  {"UM","United States Minor Outlying Islands"},
  {"UY","Uruguay"},
  {"UZ","Usbekistan"},
  {"VU","Vanuatu"},
  {"VA","Vatikanstadt"},
  {"VE","Venezuela"},
  {"AE","Vereinigte Arabische Emirate"},
  {"VN","Vietnam"},
  {"WF","Wallis und Futuna"},
  {"CX","Weihnachtsinsel"},
  {"EH","Westsahara"},
  {"ZR","Demokratische Republik Kongo"},
  {"CF","Zentralafrikanische Republik"},
  {"CY","Zypern"}
}


function p.toRegionIndicator(frame)
    local text = frame.args[1]
    text = mw.ustring.gsub( text, 'A', '🇦')
    text = mw.ustring.gsub( text, 'B', '🇧')
    text = mw.ustring.gsub( text, 'C', '🇨')
    text = mw.ustring.gsub( text, 'D', '🇩')  
    text = mw.ustring.gsub( text, 'E', '🇪')
    text = mw.ustring.gsub( text, 'F', '🇫')
    text = mw.ustring.gsub( text, 'G', '🇬')
    text = mw.ustring.gsub( text, 'H', '🇭')
    text = mw.ustring.gsub( text, 'I', '🇮')
    text = mw.ustring.gsub( text, 'J', '🇯')
    text = mw.ustring.gsub( text, 'K', '🇰')
    text = mw.ustring.gsub( text, 'L', '🇱')
    text = mw.ustring.gsub( text, 'M', '🇲')
    text = mw.ustring.gsub( text, 'N', '🇳')
    text = mw.ustring.gsub( text, 'O', '🇴')
    text = mw.ustring.gsub( text, 'P', '🇵')
    text = mw.ustring.gsub( text, 'Q', '🇶')
    text = mw.ustring.gsub( text, 'R', '🇷')
    text = mw.ustring.gsub( text, 'S', '🇸')
    text = mw.ustring.gsub( text, 'T', '🇹')
    text = mw.ustring.gsub( text, 'U', '🇺')
    text = mw.ustring.gsub( text, 'V', '🇻')
    text = mw.ustring.gsub( text, 'W', '🇼')
    text = mw.ustring.gsub( text, 'X', '🇽')
    text = mw.ustring.gsub( text, 'Y', '🇾')
    text = mw.ustring.gsub( text, 'Z', '🇿')

    return text
end

function p.toNameDe(frame)
  local abbr = frame.args[1]
  for key,region in pairs(countryNamesDe) do
    if countryNamesDe[key][1] == abbr then
      return countryNamesDe[key][2]
    end
  end
  return "Land unbekannt"
end
return p