es.example.com and en.example.com are separate hosts, and example.com/es and example.com/en will be on the same host.
Some technologies / software / services may consider that different hosts correspond to different sites. For instance. some search engines may treat different subdomains as different websites.
I would go this way:
If the website structure is the same or very similar for all languages โโ(for example, all / most pages are translated), go to the language code in the path.
If the website structure may (or may become) different for each language, go to the language code in the subdomain. Also, if the user of the Spanish site cannot log into the English site and vice versa.
So, a small company website translated into 3 languages โโshould use the path (because all pages are translated and the information architecture is the same), while a multilingual forum should use a subdomain (because all threads / comments will be not translated).
You might also consider: in the future, you may want to publish additional sites on your own subdomain. If you went with the language code in the subdomain, this "polluted" the level of the subdomain:
- en.example.com
- es.example.com
- blog.example.com (new site)
If you want to translate the blog site, you will also have sub-subdomains:
- en.example.com
- es.example.com
- en.blog.example.com
- es.blog.example.com
Instead, if you used the language code in the path, you would get:
- example.com/en/
- example.com/es/
- blog.example.com/en/
- blog.example.com/es/
unor source share