I want my website to be in English and French, but I'm not sure how to make this happen. I have an excel spreadsheet with French translations for each English page in the site.

How to translations work? I would prefer to code it myself instead of using a plugin.



I'd recommend you using Loco Translate plugin to create a translation. If you are creating a theme, you should specify the Text Domain and Domain Path in your style.css file.

Theme Name: My Theme Name
Author: My Name
Author URI: http://sample.url
Description: Your theme description
Version: 1.0.0
Text Domain: mydomain
Domain Path: /lang

Next, add some text in your theme.

<?php echo __( 'Hello there', 'mydomain' ); ?>

Then go to your wp-admin and you should find Hello there text and translate it to any languages you wish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.