Extranjero vs. forastero
The Spanish language has different words to describe people who are not from one's own country or geographic region. Two such words are 'extranjero' and 'forastero'. While both can translate to 'foreigner' in English, they have slightly different connotations in Spanish.
Extranjero
An 'extranjero' typically refers to someone from a different country. This foreigner, in terms of nationality, comes from a country other than the one being referred to.
Él es extranjero, viene de Alemania.
(He is foreigner, he is from Germany.)
Los extranjeros deben presentar sus pasaportes en el aeropuerto.
(Foreigners must present their passports at the airport.)
Forastero
A 'forastero' generally refers to someone who is not from the specific town, region or community being referred to, but they may still be from the same country. This term has more regional connotations within a given country, used for someone unfamiliar or an outsider within a certain place.
En ese pequeño pueblo no conocen a los forasteros.
(In that small village they do not know outsiders.)
El forastero se perdió porque no conocía bien la ciudad.
(The outsider got lost because he did not know the city well.)
Summary
In summary, while both 'extranjero' and 'forastero' can translate as 'foreigner' in English, the former tends to refer more globally (to someone from another country) while the latter is more locally or regionally oriented (to someone who is an outsider within a certain town or region, but may still be from the same country). The nuances between these two words can add precision in communication about individuals related to different places in Spanish.