Normally translation is not done dynamically. All content are translated manually and put into deployment, and the runtime system will determine dynamically which version to serve based on user environments.
There are many ways to achieve this, depending on how you would like to implement it.
Easiest way is to do this in Apache, if you are just serving static HTML files. Just name the different language versions of the files with different extension suffices. This is called content negotiation in Apache. The authoritative coverage is in the official documentation, but you can find easier articles on the web:
Content Negotiation - Apache HTTP Server
Otherwise, if your content is generated by some server-side environment such as PHP, CGI (Perl, Python ...), Java etc. then you will need to adopt mechanisms specific to the environment for supporting internationalization. Many development frameworks today support internationalization in some ways. Otherwise, you are always free to implement your own.