I will summarize well, pt
indicates Portuguese, regardless of country / region as:
Source: Which countries and regions speak Portuguese?
- Brazil (Brazil)
- Portugal (Portugal)
- São Tomé and Príncipe (São Tomé and Príncipe)
- Angola (Angola)
- Mozambique (Mozambique)
- Cape Verde (Cape Verde)
- East Timor
- Guinea-Bissau (Guinea-Bissau)
- Equatorial Guinea (Equatorial Guinea)
- Macau (Macau) †
When we use pt-BR
we indicate Portuguese of Brazil, as well as pt-PT
indicates Portuguese of Portugal.
Portuguese as well as English have variations in different countries, indicating pt-BR
, pt-PT
, pt
, en
, en-US
, en-GB
do not interfere with HTML , are only values to tell you what language you are in, for example some browsers have page language detection and they can pass to some plugin, or an add-on can use the attribute directly. / p>
Placing the URL of the page that uses this attribute on link will detect that that <div lang="pt-BR"></div>
uses Brazilian Portuguese (although google does not differ much either).
Others that can usually use this attribute are search engines like Google, Bing, Yahoo, Baidu. Search engines use these attributes to deliver pages of the regional and language preference of a person they are searching for.
Now speaking only HTML, the lang
attribute regardless of its value, pt
or pt-BR
does not change at all, the idea of using it is normalize and indicate the types of data for those who have interest, if there is no such attribute plugins, google translator or search engines have more difficulty detecting the language and region of the page.