CountryCodes - Match 2 letter country code to continent

All country codes in the world matched up with their respective continent, for region display.

What is CountryCodes?
When using LocalizationService:GetCountryRegionForPlayerAsync() it returns a 2 letter code this is a table to get the continent the player is in for example to use if you have a server list so players can view the region of a server to optimize their ping while playing :slight_smile:

Table format: Code = “Region”

Example:
AF = “Asia” (afghanistan)
BR = “South America” (brazil)

Example Usage:

local Player = game.Players.LocalPlayer
local LocalizationService = game:GetService("LocalizationService")
local CountryCodes = require(game:GetService("ReplicatedStorage".CountryCodes)
local CountryCode = LocalizationService:GetCountryRegionForPlayerAsync(Player)

print(CountryCodes[CountryCode])

The code above will print the continent the player is in, so for example Asia, North America, Europe etc. Personally I use this for the serverlist in my game but you can use this however you want.

12 Likes

Thanks so much, I was looking for a way to find 2 letter codes to a continent!

2 Likes