Here is how to make your site multilingual using gettext and php.

Concept is simple, default language is “en”, and language is changed based on subdomain.

For example fr.domain.com would load french localization.

Directory structure (languages is located in the project root):

Each language LC_MESSAGES directory should contain .mo and .po.

And in php files you need to change all texts that need to be translatable into:

Leave a Reply

Your email address will not be published. Required fields are marked *