Modified replace function

Modified replace function to make it use mapping values from a dictionary of country and language codes (the values for mapping come from a pycountry package)